Constructs new Player object from given entity unique ID. Use Actor.isValid and Actor.isPlayer first, to check if entity with this ID exists and it's a Player, or a java.lang.IllegalArgumentException will be thrown.
Constructs new Player object from an existing Mob object. Throws java.lang.IllegalArgumentException if the given Mob is not a Player. You should better use Actor.asPlayer, that will return null in case your Mob is not a Player.
Constructs new Player object from an existing Actor object. Throws java.lang.IllegalArgumentException if the given Actor is not a Player. You should better use Actor.asPlayer, that will return null in case your Actor is not a Player.
Copy of PlayerActor.addExperience. Adds experience to the player.
Copy of PlayerActor.addItemToInventory. Adds item to player's inventory.
if true, surplus will be dropped near player
Copy of PlayerActor.getExhaustion
player's exhaustion
Copy of PlayerActor.getLevel.
player's experience level.
Copy of PlayerActor.getExperience.
player's experience.
Copy of PlayerActor.getGameMode.
player's gamemode.
Copy of PlayerActor.getHunger.
player's hunger
Copy of PlayerActor.getInventorySlot.
inventory slot's contents.
pointer to the native object wrapped by the following Actor object, represented by a signed 64-bit integer
Copy of PlayerActor.getSaturation.
player's saturation
Copy of PlayerActor.getScore.
player's score
Copy of PlayerActor.getSelectedSlot.
player's selected slot.
Copy of PlayerActor.setExhaustion Sets player exhaustion.
Copy of PlayerActor.setExperience. Sets player's experience.
Copy of PlayerActor.setHunger Sets player's hunger.
Copy of PlayerActor.setInventorySlot. Sets inventory slot's contents.
Copy of PlayerActor.setRespawnCoords. Sets respawn coords for the player.
Copy of PlayerActor.setSaturation. Sets player's saturation.
Copy of PlayerActor.setSelectedSlot. Sets player's selected slot.
Copy of PlayerActor.spawnExpOrbs. Spawns experience orbs on coords.
experience points value
whether the entity with given unique ID currently exists in the world. Use it when you construct Actor and its subclasses, otherwise you will get a java.lang.IllegalArgumentException telling you there is no entity with given id.
Generated using TypeDoc
Wrapper for the native
Player
class extending Mob and giving access to methods associated specifically with the player entity.For convenience, it duplicates all the methods from InnerCore's PlayerActor, and of course adds bunch of new ones.
You can construct new Player from an existing Actor or Mob, or call Actor.asPlayer.
First will throw java.lang.IllegalArgumentException, second will return null, if given Actor or Mob is not a Player.
2.0