player
This page will go over the Player API namespace.
This is based on EntityLiving class, therefore this support every method from Entity, as well as EntityLiving class.
Methods from the superclasses
isAnimal(): Boolean
isAnimal(): Boolean
Returns if the entity is an animal.
isMob(): Boolean
isMob(): Boolean
Returns if the entity is a mob.
isPlayer(): Boolean
isPlayer(): Boolean
Returns if the entity is a player.
getHealth(): Number
getHealth(): Number
Returns the entity health.
getMaxHealth(): Number
getMaxHealth(): Number
Returns the maximum entity health.
getHurtTime(): Number
getHurtTime(): Number
Returns the entity hurt time.
getMaxHurtTime(): Number
getMaxHurtTime(): Number
Returns the maximum entity hurt time.
getLastHurtTime(): Number
getLastHurtTime(): Number
Returns the last entity hurt time.
getHeldItemStack(): ItemStack
getHeldItemStack(): ItemStack
Returns the held item stack of the entity.
isDead(): Boolean
isDead(): Boolean
Returns if the entity is dead.
isLiving(): Boolean
isLiving(): Boolean
Returns if the entity is instance of LivingEntity.
getPosition(): Vector3
getPosition(): Vector3
Returns the entity position.
getLastPosition(): Vector3
getLastPosition(): Vector3
Returns the previous tick entity position.
getMotion(): Vector3
getMotion(): Vector3
Returns the entity motion.
getRotation(): Vector2
getRotation(): Vector2
Returns the entity rotation.
getLastRotation(): Vector2
getLastRotation(): Vector2
Returns the previous tick entity rotation.
getTicksExisted(): Number
getTicksExisted(): Number
Returns the amount of ticks the entity has existed for.
getEntityId(): Number
getEntityId(): Number
Returns the entity ID.
getDisplayName(): String
getDisplayName(): String
Returns the entity display name.
getInventory(): Inventory
getInventory(): Inventory
Returns the inventory of the entity.
getDistanceToEntity(entity): Number
getDistanceToEntity(entity): Number
entity
Entity
Another entity
Returns distance between this and another entity.
getDistance(x, y, z): Number
getDistance(x, y, z): Number
x
Number
X position.
y
Number
Y position.
z
Number
Z position.
Returns the distance between this entity and the specified position.
Exclusive to player API, not found in superclasses.
message(text): Undefined
message(text): Undefined
text
String
Text to send in the chat.
Sends a chat message.
getName(): String
getName(): String
Returns the player name.
getPlayerID(): String
getPlayerID(): String
Returns the player ID.
isOnGround(): Boolean
isOnGround(): Boolean
Returns the mc.thePlayer.onGround
variable
isMoving(): Boolean
isMoving(): Boolean
Returns if the player is moving or not.
jump(): Undefined
jump(): Undefined
Makes the player jump.
setSlot(Number slot): Undefined
setSlot(Number slot): Undefined
Sets your slot.
strafe(speed): Undefined
strafe(speed): Undefined
speed
(Optional argument) Number
The speed to strafe at.
Makes the player strafe. speed
argument is optional.
stop(): Undefined
stop(): Undefined
Stops the player instantly.
setPosition(posX, posY, posZ): Undefined
setPosition(posX, posY, posZ): Undefined
posX
Number
Position X.
posY
Number
Position Y.
posZ
Number
Position Z.
Sets the player position with 3 Number
arguments.
setPosition(vector): Undefined
setPosition(vector): Undefined
vector
Vector3d
Vector3d with the player position.
Sets the player motion with a single Vector3d argument.
setMotion(motionX, motionY, motionZ): Undefined
setMotion(motionX, motionY, motionZ): Undefined
motionX
Number
Motion X.
motionY
Number
Motion Y.
motionZ
Number
Motion Z.
Sets the player motion with 3 Number
arguments.
setMotionX(motionX): Undefined
setMotionX(motionX): Undefined
motionX
Number
The Motion X to apply to the player.
Sets the player motion on the X axis.
setMotionY(motionY): Undefined
setMotionY(motionY): Undefined
motionY
Number
The Motion Y to apply to the player.
Sets the player motion on the Y axis.
setMotionZ(motionZ): Undefined
setMotionZ(motionZ): Undefined
motionZ
Number
The Motion Z to apply to the player.
Sets the player motion on the Z axis.
setMotion(vector): Undefined
setMotion(vector): Undefined
vector
Vector3d
Vector3d with the player motion.
Sets the player motion with a single Vector3d argument.
leftClick(): Undefined
leftClick(): Undefined
Clicks left mouse button.
rightClick(): Undefined
rightClick(): Undefined
Clicks right mouse button.
attackEntity(target): Undefined
attackEntity(target): Undefined
target
EntityLiving
The entity to attack.
Attacks the target entity.
swingItem(): Undefined
swingItem(): Undefined
Swings the currently held item.
message(message): Undefined
message(message): Undefined
message
String
Message to send
Sends a chat message. You can not execute rise commands with this.
setRotation(rotations, rotationSpeed, movementFix): Undefined
setRotation(rotations, rotationSpeed, movementFix): Undefined
rotations
Vector2
Angles to rotate to.
rotationSpeed
Number
Speed to rotate at. 10 is the maximum speed. 1 section is 18 degrees per tick.
movementFix
Boolean
Whether to fix movement to sync with the rotations or not.
Silently rotates your player to a specific set of angles.
setHeldItem(slot, render): Undefined
setHeldItem(slot, render): Undefined
Run this on preUpdate for every tick you want the slot to be changed, if you want to permanently setslot use the "setSlot" method.
slot
Number
Hotbar slot to use.
render
Boolean
Whether to render the actually held item. This argument is optional.
Silently sets a held item.
getHeldItemStack():
ItemStack
getHeldItemStack():
ItemStack
Returns the serverside held item stack.
getClientHeldItemStack():
ItemStack
getClientHeldItemStack():
ItemStack
Returns the clientside held item stack.
getClientHeldItemSlot(): Number
getClientHeldItemSlot(): Number
Returns the clientside held item slot.
itemDamage(): Undefined
itemDamage(): Undefined
Damages the player using a snowball/fishing rod/bow.
damage(packet, timer): Undefined
damage(packet, timer): Undefined
packet
Boolean
Whether to do instant damage or slow damage.
timer
Number
Timer for the slow damage. This argument is optional and defaults to 1.
Damages the player without an item.
fakeDamage(): Undefined
fakeDamage(): Undefined
Fake damages the player.
calculateRotations(to): Vector2
calculateRotations(to): Vector2
to
Vector3
or Entity
Entity or position to calculate rotations to.
Calculates rotations towards an entity / a position in the world.
getHurtTime(): Number
getHurtTime(): Number
Returns the players hurt time.
isUsingItem(): Boolean
isUsingItem(): Boolean
Returns whether the player is using an item.
isHoldingSword(): Boolean
isHoldingSword(): Boolean
Returns whether the player is holding a sword.
isHoldingTool(): Boolean
isHoldingTool(): Boolean
Returns whether the player is holding a tool.
isHoldingBlock(): Boolean
isHoldingBlock(): Boolean
Returns whether the player is holding blocks.
getFoward(): Number
getFoward(): Number
Returns a value depending on if forward or backwards are being pressed.
getStrafe(): Number
getStrafe(): Number
Returns a value depending on if left or right is being pressed.
getSpeed(): Number
getSpeed(): Number
Returns players speed.
getUseItemProgress(): Number
(): Number
Returns use item progress.
setSprinting(sprinting): Undefined
(sprinting): Undefined
Sets sprinting.
setClientRotations(yaw, pitch): Undefined
(yaw, pitch): Undefined
Sets client rotations.
getUseItemProgress(): Number
(): Number
Returns use item progress.
getFallDistance(): Number
(): Number
Returns fall distance.
getHunger(): Number
(): Number
Returns hunger.
getAbsorption(): Number
(): Number
Returns absorption.
isInWater(): Boolean
(): Boolean
Returns true if in water.
isInLava(): Boolean
(): Boolean
Returns true if in water.
setSneaking(sneaking): Undefined
(sneaking): Undefined
Sets sneaking.
isInWeb(): Boolean
(): Boolean
Returns true if in a web.
isOnLadder(): Boolean
(): Boolean
Returns true if on a ladder.
isCollided(): Boolean
(): Boolean
Returns true if collided.
isCollidedHorizontally(): Boolean
(): Boolean
Returns true if collided horizontally.
isCollidedVertically(): Boolean
(): Boolean
Returns true if collided vertically.
isPotionActive(Number potionID): Boolean
(Number potionID): Boolean
Returns true if the potion is active, refer to https://pastebin.com/U9SyiD9Y for potion ids.
placeBlock(
ItemStack heldStack, Vector3d blockPos, Number side, Vector3d hitVec): Undefined
(
ItemStack heldStack, Vector3d blockPos, Number side, Vector3d hitVec): Undefined
Allows you to place a block.
getGUI(): String
(): String
Returns the name of the GUI you're in.
mouseOverEntity(entity, range): Boolean
mouseOverEntity(entity, range): Boolean
entity
Entity
The Entity object of a Entity you want to check.
range
Number
The maximum distance of the entity (from the player)
Returns whether a player is aiming over an entity. Also includes rotations that are set by other modules.
Last updated