entity
Entity related functions.
Assumes variable entity
is defined.
Example: Entity entity = client.getPlayer();
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
float air = entity.getAir();
Returns the air level of the entity.
getArmorInSlot
ItemStack armor = entity.getArmorInSlot(int slot);
Returns the specified armor piece the entity is wearing.
getBlockPosition
Vec3 blockPosition = entity.getBlockPosition();
Returns the block position of the entity.
getBPS
double bps = entity.getBPS();
Returns the movement speed of the entity in blocks per second.
getDisplayName
String displayName = entity.getDisplayName();
Returns the display name of the entity.
getExperience
float experience = entity.getExperience();
Returns the experience of the entity.
getExperienceLevel
int level = entity.getExperienceLevel();
Returns the experience level of the entity.
getEyeHeight
float eyeHeight = entity.getEyeHeight();
Returns the eye height of the entity.
getFacing
String facing = entity.getFacing();
Returns which direction the entity is facing.
getFallDistance
float fallDistance = entity.getFallDistance();
Returns the fall distance of the entity.
getFireResistance
int fireResistance = entity.getFireResistance();
Returns the fire resistance of the entity.
getFisher
Entity fisher = entity.getFisher();
Returns the entity which cast the fishing hook.
getHealth
float health = entity.getHealth();
Returns the health of the entity.
getHeight
float height = entity.getHeight();
Returns the height of the entity.
getHeldItem
ItemStack item = entity.getHeldItem();
Returns the item held by the entity.
getHunger
int hunger = entity.getHunger();
Returns the hunger level of the entity.
getHurtTime
int hurtTime = entity.getHurtTime();
Returns the hurt time of the entity.
getLastPosition
Vec3 lastPosition = entity.getLastPosition();
Returns the previous position of the entity.
getMaxHealth
float maxHealth = entity.getMaxHealth();
Returns the maximum health of the entity.
getMaxHurtTime
int maxHurtTime = entity.getMaxHurtTime();
Returns the maximum hurt time of the entity.
getName
String name = entity.getName();
Returns the name of the entity.
getNetworkPlayer
NetworkPlayer networkPlayer = player.getNetworkPlayer();
Returns the NetworkPlayerInfo object of a player.
getPitch
float pitch = entity.getPitch();
Returns the pitch of the entity.
getPosition
Vec3 position = entity.getPosition();
Returns the position of the entity.
getPotionEffects
List<Object[]> effects = entity.getPotionEffects();
Returns the active potion effects of the entity.
id
0
int
name
1
String
amplifier
2
int
duration
3
int
getPrevPitch
float pitch = entity.getPrevPitch();
Returns the previous pitch of the entity.
getPrevYaw
float yaw = entity.getPrevYaw();
Returns the previous yaw of the entity.
getRiddenByEntity
Entity riddenBy = entity.getRiddenByEntity();
Returns the entity riding the entity.
getRidingEntity
Entity riding = entity.getRidingEntity();
Returns the entity the entity is riding.
getSaturation
float saturation = entity.getSaturation();
Returns the saturation of the entity.
getServerPosition
Vec3 position = entity.getServerPosition();
Returns the server position of the entity.
getSpeed
double speed = entity.getSpeed();
Returns the speed of the entity.
getSwingProgress
int swingProgress = entity.getSwingProgress();
Returns the swing animation progress of the entity.
getTicksExisted
int ticksExisted = entity.getTicksExisted();
Returns the number of ticks the entity has existed.
getWidth
float width = entity.getWidth();
Returns the width of the entity.
getYaw
float yaw = entity.getYaw();
Returns the yaw of the entity.
isBurning
boolean burning = entity.isBurning();
Returns true if the entity is burning.
isCollided
boolean collided = entity.isCollided();
Returns true if the entity is collided.
isCollidedHorizontally
boolean collidedHorizontally = entity.isCollidedHorizontally();
Returns true if the entity is collided horizontally.
isCollidedVertically
boolean collidedVertically = entity.isCollidedVertically();
Returns true if the entity is collided vertically.
isConsuming
boolean consuming = entity.isConsuming();
Returns true if the entity is consuming an item.
isCreative
boolean creative = entity.isCreative();
Returns true if the entity is in creative mode.
isDead
boolean dead = entity.isDead();
Returns true if the entity is dead.
isHoldingBlock
boolean holdingBlock = entity.isHoldingBlock();
Returns true if the entity is holding a block.
isHoldingWeapon
boolean holdingWeapon = entity.isHoldingWeapon();
Returns true if the entity is holding a weapon.
isInLava
boolean inLava = entity.isInLava();
Returns true if the entity is in lava.
isInLiquid
boolean inLiquid = entity.isInLiquid();
Returns true if the entity is in liquid.
isInvisible
boolean invisible = entity.isInvisible();
Returns true if the entity is invisible.
isInWater
boolean inWater = entity.isInWater();
Returns true if the entity is in water.
isOnEdge
boolean isOnEdge = entity.isOnEdge();
Returns true if the entity is on an edge.
isOnLadder
boolean onLadder = entity.isOnLadder();
Returns true if the entity is on a ladder.
isRiding
boolean riding = entity.isRiding();
Returns true if the entity is riding.
isSleeping
boolean sleeping = entity.isSleeping();
Returns true if the entity is sleeping.
isSneaking
boolean sneaking = entity.isSneaking();
Returns true if the entity is sneaking.
isSprinting
boolean sprinting = entity.isSprinting();
Returns true if the entity is sprinting.
isUsingItem
boolean usingItem = entity.isUsingItem();
Returns true if the entity is using an item.
onGround
boolean onGround = entity.onGround();
Returns true if the entity is on the ground.
setPitch
entity.setPitch(float pitch);
Sets the pitch of the entity.
setPosition
entity.setPosition(Vec3 position);
entity.setPosition(double x, double y, double z)
Sets the position of the entity.
setYaw
entity.setYaw(float yaw);
Sets the yaw of the entity.
Last updated