entity

Entity related functions.

distanceTo

double distance = entity1.getPosition().distanceTo(entity2.getPosition());

Returns the distance to a position in blocks.

distanceToGround

double distance = entity1.distanceToGround();

Returns the distance from the entity to the ground.

distanceToSq

double distanceSquared = entity1.getPosition().distanceToSq(entity2.getPosition());

Returns the distance to a position in blocks squared.

getAbsorption

float absorption = entity.getAbsorption();

Returns the absorption level of the entity.

getAir

Returns the air level of the entity.

getArmorInSlot

Returns the specified armor piece the entity is wearing.

getBlockPosition

Returns the block position of the entity.

getBPS

Returns the movement speed of the entity in blocks per second.

getDisplayName

Returns the display name of the entity.

getExperience

Returns the experience of the entity.

getExperienceLevel

Returns the experience level of the entity.

getEyeHeight

Returns the eye height of the entity.

getFacing

Returns which direction the entity is facing.

getFallDistance

Returns the fall distance of the entity.

getFireResistance

Returns the fire resistance of the entity.

getFisher

Returns the entity which cast the fishing hook.

getHealth

Returns the health of the entity.

getHeight

Returns the height of the entity.

getHeldItem

Returns the item held by the entity.

getHunger

Returns the hunger level of the entity.

getHurtTime

Returns the hurt time of the entity.

getLastPosition

Returns the previous position of the entity.

getMaxHealth

Returns the maximum health of the entity.

getMaxHurtTime

Returns the maximum hurt time of the entity.

getName

Returns the name of the entity.

getNetworkPlayer

Returns the NetworkPlayerInfo object of a player.

getPitch

Returns the pitch of the entity.

getPosition

Returns the position of the entity.

getPotionEffects

Returns the active potion effects of the entity.

property
index
type

id

0

int

name

1

String

amplifier

2

int

duration

3

int

getPrevPitch

Returns the previous pitch of the entity.

getPrevYaw

Returns the previous yaw of the entity.

getRiddenByEntity

Returns the entity riding the entity.

getRidingEntity

Returns the entity the entity is riding.

getSaturation

Returns the saturation of the entity.

getServerPosition

Returns the server position of the entity.

getSpeed

Returns the speed of the entity.

getSwingProgress

Returns the swing animation progress of the entity.

getTicksExisted

Returns the number of ticks the entity has existed.

getWidth

Returns the width of the entity.

getYaw

Returns the yaw of the entity.

isBurning

Returns true if the entity is burning.

isCollided

Returns true if the entity is collided.

isCollidedHorizontally

Returns true if the entity is collided horizontally.

isCollidedVertically

Returns true if the entity is collided vertically.

isConsuming

Returns true if the entity is consuming an item.

isCreative

Returns true if the entity is in creative mode.

isDead

Returns true if the entity is dead.

isHoldingBlock

Returns true if the entity is holding a block.

isHoldingWeapon

Returns true if the entity is holding a weapon.

isInLava

Returns true if the entity is in lava.

isInLiquid

Returns true if the entity is in liquid.

isInvisible

Returns true if the entity is invisible.

isInWater

Returns true if the entity is in water.

isOnEdge

Returns true if the entity is on an edge.

isOnLadder

Returns true if the entity is on a ladder.

isRiding

Returns true if the entity is riding.

isSleeping

Returns true if the entity is sleeping.

isSneaking

Returns true if the entity is sneaking.

isSprinting

Returns true if the entity is sprinting.

isUsingItem

Returns true if the entity is using an item.

onGround

Returns true if the entity is on the ground.

setPitch

Sets the pitch of the entity.

setPosition

Sets the position of the entity.

setYaw

Sets the yaw of the entity.

Last updated