public interface Player extends Entity, Actor
Modifier and Type | Method and Description |
---|---|
boolean |
ascendLevel()
Go up one level to the next free space above.
|
boolean |
ascendToCeiling(int clearance)
Ascend to the ceiling above.
|
boolean |
ascendToCeiling(int clearance,
boolean alwaysGlass)
Ascend to the ceiling above.
|
boolean |
ascendUpwards(int distance)
Just go up.
|
boolean |
ascendUpwards(int distance,
boolean alwaysGlass)
Just go up.
|
boolean |
descendLevel()
Go up one level to the next free space above.
|
void |
findFreePosition()
Find a position for the player to stand that is not inside a block.
|
void |
findFreePosition(WorldVector searchPos)
Find a position for the actor to stand that is not inside a block.
|
void |
floatAt(int x,
int y,
int z,
boolean alwaysGlass)
Make the player float in the given blocks.
|
WorldVector |
getBlockIn()
Get the point of the block that is being stood in.
|
BaseBlock |
getBlockInHand()
Get the Block that the player is holding.
|
WorldVector |
getBlockOn()
Get the point of the block that is being stood upon.
|
WorldVector |
getBlockTrace(int range)
Get the point of the block being looked at.
|
WorldVector |
getBlockTrace(int range,
boolean useLastBlock)
Get the point of the block being looked at.
|
WorldVectorFace |
getBlockTraceFace(int range,
boolean useLastBlock)
Get the face that the player is looking at.
|
PlayerDirection |
getCardinalDirection()
Get the player's cardinal direction (N, W, NW, etc.).
|
PlayerDirection |
getCardinalDirection(int yawOffset)
Get the player's cardinal direction (N, W, NW, etc.) with an offset.
|
BlockBag |
getInventoryBlockBag()
Get this actor's block bag.
|
int |
getItemInHand()
Get the ID of the item that the player is holding.
|
double |
getPitch()
Deprecated.
|
WorldVector |
getPosition()
Deprecated.
|
WorldVector |
getSolidBlockTrace(int range)
Get the point of the block being looked at.
|
World |
getWorld()
Return the world that the player is on.
|
double |
getYaw()
Deprecated.
|
void |
giveItem(int type,
int amount)
Gives the player an item.
|
boolean |
hasCreativeMode()
Return whether this actor has creative mode.
|
boolean |
isHoldingPickAxe()
Returns true if the entity is holding a pick axe.
|
boolean |
passThroughForwardWall(int range)
Pass through the wall that you are looking at.
|
void |
setOnGround(WorldVector searchPos)
Set the actor on the ground.
|
void |
setPosition(Vector pos)
Move the player.
|
void |
setPosition(Vector pos,
float pitch,
float yaw)
Move the player.
|
getExtent, getLocation, getState, remove
canDestroyBedrock, dispatchCUIEvent, getName, isPlayer, openFileOpenDialog, openFileSaveDialog, print, printDebug, printError, printRaw
getUniqueId
getSessionKey
checkPermission, getGroups, hasPermission
World getWorld()
boolean isHoldingPickAxe()
PlayerDirection getCardinalDirection(int yawOffset)
yawOffset
- offset that is added to the player's yaw before determining the cardinal directionint getItemInHand()
BaseBlock getBlockInHand() throws WorldEditException
WorldEditException
void giveItem(int type, int amount)
type
- The item id of the item to be given to the playeramount
- How many items in the stackBlockBag getInventoryBlockBag()
boolean hasCreativeMode()
void findFreePosition(WorldVector searchPos)
searchPos
- search positionvoid setOnGround(WorldVector searchPos)
searchPos
- The location to start searching fromvoid findFreePosition()
boolean ascendLevel()
boolean descendLevel()
boolean ascendToCeiling(int clearance)
clearance
- How many blocks to leave above the player's headboolean ascendToCeiling(int clearance, boolean alwaysGlass)
clearance
- How many blocks to leave above the player's headalwaysGlass
- Always put glass under the playerboolean ascendUpwards(int distance)
distance
- How far up to teleportboolean ascendUpwards(int distance, boolean alwaysGlass)
distance
- How far up to teleportalwaysGlass
- Always put glass under the playervoid floatAt(int x, int y, int z, boolean alwaysGlass)
x
- The X coordinate of the block to float iny
- The Y coordinate of the block to float inz
- The Z coordinate of the block to float inWorldVector getBlockIn()
WorldVector getBlockOn()
WorldVector getBlockTrace(int range, boolean useLastBlock)
range
- how far to checks for blocksuseLastBlock
- try to return the last valid air block foundWorldVectorFace getBlockTraceFace(int range, boolean useLastBlock)
range
- the rangeuseLastBlock
- try to return the last valid air block foundWorldVector getBlockTrace(int range)
range
- How far to checks for blocksWorldVector getSolidBlockTrace(int range)
range
- How far to checks for blocksPlayerDirection getCardinalDirection()
@Deprecated WorldVector getPosition()
Entity.getLocation()
If the actor has no permission, then a dummy location is returned.
@Deprecated double getPitch()
Entity.getLocation()
@Deprecated double getYaw()
Entity.getLocation()
boolean passThroughForwardWall(int range)
range
- How far to checks for blocksvoid setPosition(Vector pos, float pitch, float yaw)
pos
- where to move thempitch
- the pitch (up/down) of the player's view in degreesyaw
- the yaw (left/right) of the player's view in degreesvoid setPosition(Vector pos)
pos
- where to move them