Skip to content

Entity

INFO

Assumes variable entity is defined.

Example: Entity entity = client.getPlayer();

Entity

Entity represents an entity in the world with its properties and data.

propertytypedescription
typeStringsimple class name of the entity
entityIdintentity id in the world
isLivingbooleantrue if the entity extends EntityLivingBase
isPlayerbooleantrue if the entity is a player
isUserbooleantrue if the entity is the local player

distanceToGround

Returns the distance from the entity to the ground.

java
double distance = entity.distanceToGround();

getAbsorption

Returns the absorption amount, or -1 for non-living entities.

java
float absorption = entity.getAbsorption();

getArmorInSlot

Returns the armor item in the specified slot as an ItemStack. Valid slots are 0-3.

java
ItemStack armor = entity.getArmorInSlot(int slot);

getBlockPosition

Returns the entity's block position as a Vec3.

java
Vec3 blockPos = entity.getBlockPosition();

getBPS

Returns the entity's speed in blocks per second.

java
double bps = entity.getBPS();

getDisplayName

Returns the display name of the entity.

java
String displayName = entity.getDisplayName();

getEyeHeight

Returns the eye height.

java
float eyeHeight = entity.getEyeHeight();

getFallDistance

Returns the fall distance.

java
float fall = entity.getFallDistance();

getFacing

Returns the horizontal facing direction.

java
String facing = entity.getFacing();

getHealth

Returns the current health, or -1 for non-living entities.

java
float health = entity.getHealth();

getHeldItem

Returns the held item as an ItemStack, or null when empty.

java
ItemStack held = entity.getHeldItem();

getHeight

Returns the entity height.

java
float height = entity.getHeight();

getHurtTime

Returns the hurt time, or -1 for non-living entities.

java
int hurtTime = entity.getHurtTime();

getLastPosition

Returns the previous tick position as a Vec3.

java
Vec3 previous = entity.getLastPosition();

getMaxHealth

Returns the maximum health, or -1 for non-living entities.

java
float maxHealth = entity.getMaxHealth();

getMaxHurtTime

Returns the maximum hurt time, or -1 for non-living entities.

java
int maxHurt = entity.getMaxHurtTime();

getMoveAttribute

Returns current movement speed attribute getAIMoveSpeed, or -1 for non-player entities.

java
float moveAttr = entity.getMoveAttribute();

getName

Returns the registry or display name of the entity.

java
String name = entity.getName();

getNetworkPlayer

Returns the NetworkPlayer wrapper for this entity.

java
NetworkPlayer info = entity.getNetworkPlayer();

getPitch

Returns the entity pitch.

java
float pitch = entity.getPitch();

getPosition

Returns the current position as a Vec3.

java
Vec3 position = entity.getPosition();

getPotionEffects

Returns active potion effects as a list of [id, name, amplifier, duration], or null when none.

java
List<Object[]> effects = entity.getPotionEffects();

getSpeed

Returns the horizontal movement speed per tick.

java
double speed = entity.getSpeed();

getSwingProgress

Returns the swing progress tick count, or -1 for non-living entities.

java
int swing = entity.getSwingProgress();

getTicksExisted

Returns the ticks existed value.

java
int ticks = entity.getTicksExisted();

getUUID

Returns the entity UUID as a string.

java
String uuid = entity.getUUID();

getWidth

Returns the entity width.

java
float width = entity.getWidth();

getYaw

Returns the entity yaw.

java
float yaw = entity.getYaw();

isBurning

Returns true if the entity is burning.

java
boolean burning = entity.isBurning();

isCollided

Returns true if the entity is colliding.

java
boolean collided = entity.isCollided();

isCollidedHorizontally

Returns true if the entity collides horizontally.

java
boolean collidedHoriz = entity.isCollidedHorizontally();

isCollidedVertically

Returns true if the entity collides vertically.

java
boolean collidedVert = entity.isCollidedVertically();

isConsuming

Returns true if the player entity is consuming an item.

java
boolean consuming = entity.isConsuming();

isDead

Returns true if the entity is dead.

java
boolean dead = entity.isDead();

isHoldingBlock

Returns true if the entity is holding a block item.

java
boolean holdingBlock = entity.isHoldingBlock();

isHoldingSword

Returns true if the entity is holding a sword.

java
boolean holdingSword = entity.isHoldingSword();

isHoldingWeapon

Returns true if the entity is holding a weapon recognised by Raven.

java
boolean holdingWeapon = entity.isHoldingWeapon();

isInvisible

Returns true if the entity is invisible.

java
boolean invisible = entity.isInvisible();

isInLava

Returns true if the entity is in lava.

java
boolean inLava = entity.isInLava();

isInLiquid

Returns true if the entity is in water or lava.

java
boolean inLiquid = entity.isInLiquid();

isInWater

Returns true if the entity is in water.

java
boolean inWater = entity.isInWater();

isOnEdge

Returns true if the entity is standing on an edge.

java
boolean onEdge = entity.isOnEdge();

onGround

Returns true if the entity is on the ground.

java
boolean grounded = entity.onGround();

isOnLadder

Returns true if the entity is on a ladder.

java
boolean onLadder = entity.isOnLadder();

isRiding

Returns true if the entity is riding another entity.

java
boolean riding = entity.isRiding();

isSleeping

Returns true if the player entity is sleeping.

java
boolean sleeping = entity.isSleeping();

isSneaking

Returns true if the entity is sneaking.

java
boolean sneaking = entity.isSneaking();

isSprinting

Returns true if the entity is sprinting.

java
boolean sprinting = entity.isSprinting();

isSwinging

Returns true if the entity is currently swinging.

java
boolean swinging = entity.isSwinging();

isUsingItem

Returns true if the player entity is using an item.

java
boolean usingItem = entity.isUsingItem();

setPitch

Sets the entity pitch.

java
entity.setPitch(float pitch);

setPosition

Sets the entity position.

java
entity.setPosition(Vec3 position);
entity.setPosition(double x, double y, double z);

setYaw

Sets the entity yaw.

java
entity.setYaw(float yaw);