Constructs new LocalPlayer object from given entity unique ID. Use Actor.isValid and Actor.isLocalPlayer first, to check if entity with this ID exists and it's a LocalPlayer, or a java.lang.IllegalArgumentException will be thrown.
Constructs new LocalPlayer object from an existing Player object. Throws java.lang.IllegalArgumentException if the given Player is not a LocalPlayer. You should better use Actor.asLocalPlayer, that will return null in case your Player is not a LocalPlayer.
Constructs new LocalPlayer object from an existing Mob object. Throws java.lang.IllegalArgumentException if the given Mob is not a LocalPlayer. You should better use Actor.asLocalPlayer, that will return null in case your Mob is not a LocalPlayer.
Constructs new LocalPlayer object from an existing Actor object. Throws java.lang.IllegalArgumentException if the given Actor is not a LocalPlayer. You should better use Actor.asLocalPlayer, that will return null in case your Actor is not a LocalPlayer.
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.
MoveInputHandler object of the following LocalPlayer, or null if this LocalPlayer doesn't have it for some reason.
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.
whether the following LocalPlayer is flying at the moment
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
LocalPlayer
class extending Player and adding some new methods associated specifically with the client-side player entity.You can construct new LocalPlayer from an existing Actor, Mob or Player, or call Actor.asLocalPlayer.
First will throw java.lang.IllegalArgumentException, second will return null, if given Actor, Mob or Player is not a LocalPlayer.
2.0