LivingEntityAPI

subclasses EntityAPI

Acts as a proxy for a living entity in the Minecraft world

LivingEntityAPI.isBlocking

Return if this entity is blocking with a shield
overload 1:
LivingEntityAPI:isBlocking()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getAbsorptionAmount

Returns the amount of this entity's absorption (yellow hearts)
overload 1:
LivingEntityAPI:getAbsorptionAmount()
Method Property Fluent Description Representation
Return Value a Number

LivingEntityAPI.getBodyYaw

Gets the yaw of this entity's body in degrees
If delta is passed in,
then it will be used to linearly interpolate the rotation of the body between the previous tick and the current tick
The default value of delta is 1
overload 1:
LivingEntityAPI:getBodyYaw()
Method Property Fluent Description Representation
Return Value a Number
overload 2:
LivingEntityAPI:getBodyYaw(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Number

LivingEntityAPI.isUsingItem

Returns true if the entity is currently using an item
overload 1:
LivingEntityAPI:isUsingItem()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getActiveItem

Returns an ItemStack representing the item the entity is currently using
If they're not using any item,
returns air
overload 1:
LivingEntityAPI:getActiveItem()
Method Property Fluent Description Representation
Return Value an ItemStack

LivingEntityAPI.isSensitiveToWater

Returns if this entity takes damage to water
overload 1:
LivingEntityAPI:isSensitiveToWater()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getHealth

Returns the amount of health this entity has remaining
overload 1:
LivingEntityAPI:getHealth()
Method Property Fluent Description Representation
Return Value a Number

LivingEntityAPI.isClimbing

Returns true if the entity is currently using a climbable block, like a ladder or vine
overload 1:
LivingEntityAPI:isClimbing()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getArmor

Returns the amount of armor points this entity has
overload 1:
LivingEntityAPI:getArmor()
Method Property Fluent Description Representation
Return Value a Number

LivingEntityAPI.getEntityCategory

Returns the category of this entity
The categories are: "ARTHROPOD",
"UNDEAD", "WATER", "ILLAGER" and by default, "UNDEFINED"
overload 1:
LivingEntityAPI:getEntityCategory()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.getArrowCount

Returns the number of arrows sticking out of this entity
overload 1:
LivingEntityAPI:getArrowCount()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.isSwingingArm

Returns true if the entity is currently swinging its arm
overload 1:
LivingEntityAPI:isSwingingArm()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isLeftHanded

Returns true if the entity's main hand is its left
overload 1:
LivingEntityAPI:isLeftHanded()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getActiveHand

Returns "OFF_HAND" or "MAIN_HAND", depending on which hand this entity uses an item with
overload 1:
LivingEntityAPI:getActiveHand()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.getHeldItem

Returns an ItemStack representing the item in this entity's main hand
If true is passed in for "offhand",
then it will instead look at the item in the entity's offhand
If the entity isn't holding an item in that hand,
returns air
overload 1:
LivingEntityAPI:getHeldItem()
Method Property Fluent Description Representation
Return Value an ItemStack
overload 2:
LivingEntityAPI:getHeldItem(offhand)
Method Property Fluent Description Representation
offhand accepts a Boolean
Return Value an ItemStack

LivingEntityAPI.getDeathTime

Returns the number of ticks this entity has been dead for
overload 1:
LivingEntityAPI:getDeathTime()
Method Property Fluent Description Representation
Return Value a Number

LivingEntityAPI.getActiveItemTime

Returns the ticks this entity's active item has been used for
overload 1:
LivingEntityAPI:getActiveItemTime()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.getStingerCount

Returns the number of bee stingers sticking out of this entity
overload 1:
LivingEntityAPI:getStingerCount()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.getSwingTime

Returns the number of ticks this entity has the arm swinging
overload 1:
LivingEntityAPI:getSwingTime()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.getSwingArm

Returns "OFF_HAND" or "MAIN_HAND", based on the arm this entity is currently swinging
overload 1:
LivingEntityAPI:getSwingArm()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.getMaxHealth

Returns the maximum amount of health this entity can have
overload 1:
LivingEntityAPI:getMaxHealth()
Method Property Fluent Description Representation
Return Value a Number

LivingEntityAPI.riptideSpinning

Returns if this entity is riptide spinning
overload 1:
LivingEntityAPI:riptideSpinning()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isGliding

Returns if this entity is gliding with an elytra
overload 1:
LivingEntityAPI:isGliding()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isVisuallySwimming

Returns if this entity has the swimming pose
overload 1:
LivingEntityAPI:isVisuallySwimming()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getSwingDuration

Returns the number of ticks this entity will have while swinging its arms
overload 1:
LivingEntityAPI:getSwingDuration()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.getName

Inherited from EntityAPI

Gets the name of this entity, if it has a custom name
If it doesn't,
returns a translated form of getType()
overload 1:
LivingEntityAPI:getName()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.isAlive

Inherited from EntityAPI

Returns whether this entity is alive or not
overload 1:
LivingEntityAPI:isAlive()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getType

Inherited from EntityAPI

Gets the Minecraft identifier of this entity
For instance,
"minecraft:pig"
overload 1:
LivingEntityAPI:getType()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.isLoaded

Inherited from EntityAPI

Checks if this entity object is still being updated and loaded
A non-loaded entity would be someone or something which is in another dimension or out of the render distance for example
overload 1:
LivingEntityAPI:isLoaded()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getItem

Inherited from EntityAPI

Gets an ItemStack for the item in the given slot
For the player,
slots are indexed with 1 as the main hand, 2 as the off hand, and 3,4,5,6 as the 4 armor slots from the boots to the helmet
If an invalid slot number is given,
this will return nil
overload 1:
LivingEntityAPI:getItem(index)
Method Property Fluent Description Representation
index accepts an Integer
Return Value an ItemStack

LivingEntityAPI.getControlledVehicle

Inherited from EntityAPI

Return the vehicle that this entity is controlling
overload 1:
LivingEntityAPI:getControlledVehicle()
Method Property Fluent Description Representation
Return Value an EntityAPI

LivingEntityAPI.getControllingPassenger

Inherited from EntityAPI

Returns the entity that is controlling this entity
overload 1:
LivingEntityAPI:getControllingPassenger()
Method Property Fluent Description Representation
Return Value an EntityAPI

LivingEntityAPI.getPos

Inherited from EntityAPI

Gets the position of the entity in the world
If delta is passed in,
then it will be used to linearly interpolate the position of the entity between the previous tick and the current tick
The default value of delta is 1
overload 1:
LivingEntityAPI:getPos()
Method Property Fluent Description Representation
Return Value a Vector3
overload 2:
LivingEntityAPI:getPos(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Vector3

LivingEntityAPI.getDimensionName

Inherited from EntityAPI

Gets the Minecraft identifier of the dimension this entity is in
overload 1:
LivingEntityAPI:getDimensionName()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.getEyeHeight

Inherited from EntityAPI

Returns the current eye height of this entity
overload 1:
LivingEntityAPI:getEyeHeight()
Method Property Fluent Description Representation
Return Value a Number

LivingEntityAPI.getVehicle

Inherited from EntityAPI

Returns a proxy for the entity that this player is currently riding
If the player isn't riding anything,
returns nil
overload 1:
LivingEntityAPI:getVehicle()
Method Property Fluent Description Representation
Return Value an EntityAPI

LivingEntityAPI.isInLava

Inherited from EntityAPI

Returns true if this entity is currently in lava
overload 1:
LivingEntityAPI:isInLava()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getPose

Inherited from EntityAPI

Returns the current pose of the player
This can be one of: "STANDING",
"FALL_FLYING", "SLEEPING", "SWIMMING", "SPIN_ATTACK", "CROUCHING", "LONG_JUMPING", or "DYING"
overload 1:
LivingEntityAPI:getPose()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.getFrozenTicks

Inherited from EntityAPI

Gets the number of ticks this entity has been freezing in powder snow for
overload 1:
LivingEntityAPI:getFrozenTicks()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.isUnderwater

Inherited from EntityAPI

Returns true if this entity's eyes are touching water
overload 1:
LivingEntityAPI:isUnderwater()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getLookDir

Inherited from EntityAPI

Returns a unit vector pointing in the direction that this entity is looking
See the blue line in the F3+B screen for an example
overload 1:
LivingEntityAPI:getLookDir()
Method Property Fluent Description Representation
Return Value a Vector3

LivingEntityAPI.isInWater

Inherited from EntityAPI

Returns true if this entity is currently in a water block, including waterlogging
overload 1:
LivingEntityAPI:isInWater()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isOnGround

Inherited from EntityAPI

Returns whether or not this entity is currently on the ground
overload 1:
LivingEntityAPI:isOnGround()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getMaxAir

Inherited from EntityAPI

Gets the maximum amount of air this entity can have
overload 1:
LivingEntityAPI:getMaxAir()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.getBoundingBox

Inherited from EntityAPI

Returns the size of this entity's bounding box as a Vector3
{x,
y, z} are the width, height, and width
Minecraft entity hitboxes always have square bases
overload 1:
LivingEntityAPI:getBoundingBox()
Method Property Fluent Description Representation
Return Value a Vector3

LivingEntityAPI.isWet

Inherited from EntityAPI

Returns true in any of three conditions: if the entity is in water, if the entity is in rain, or if the entity is in a bubble column
Otherwise,
returns false
overload 1:
LivingEntityAPI:isWet()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getRot

Inherited from EntityAPI

Gets the rotation of the entity in degrees
If delta is passed in,
then it will be used to linearly interpolate the rotation of the entity between the previous tick and the current tick
The default value of delta is 1
overload 1:
LivingEntityAPI:getRot()
Method Property Fluent Description Representation
Return Value a Vector2
overload 2:
LivingEntityAPI:getRot(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Vector2

LivingEntityAPI.getUUID

Inherited from EntityAPI

Gets the UUID of the proxied entity
overload 1:
LivingEntityAPI:getUUID()
Method Property Fluent Description Representation
Return Value a String

LivingEntityAPI.getVelocity

Inherited from EntityAPI

Gets the current velocity of this entity in world coordinates, calculated as its position this tick minus its position last tick
overload 1:
LivingEntityAPI:getVelocity()
Method Property Fluent Description Representation
Return Value a Vector3

LivingEntityAPI.isSilent

Inherited from EntityAPI

Returns true if this entity is silent
overload 1:
LivingEntityAPI:isSilent()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.hasAvatar

Inherited from EntityAPI

Returns true if Figura has an avatar loaded for this entity
overload 1:
LivingEntityAPI:hasAvatar()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isInvisible

Inherited from EntityAPI

Returns true if this entity is invisible, for one reason or another
overload 1:
LivingEntityAPI:isInvisible()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isGlowing

Inherited from EntityAPI

Returns true if this entity is currently glowing
overload 1:
LivingEntityAPI:isGlowing()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isSneaking

Inherited from EntityAPI

Returns true if this entity is logically sneaking (can't fall from blocks edges, can't see nameplate behind walls, etc)
overload 1:
LivingEntityAPI:isSneaking()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isCrouching

Inherited from EntityAPI

Returns true if this entity is visually sneaking
overload 1:
LivingEntityAPI:isCrouching()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isInRain

Inherited from EntityAPI

Returns true if this entity is currently standing in rain
overload 1:
LivingEntityAPI:isInRain()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isOnFire

Inherited from EntityAPI

Returns true if this entity is currently on fire
overload 1:
LivingEntityAPI:isOnFire()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getPassengers

Inherited from EntityAPI

Returns a List of entities of all passengers this entity has
overload 1:
LivingEntityAPI:getPassengers()
Method Property Fluent Description Representation
Return Value a table

LivingEntityAPI.hasInventory

Inherited from EntityAPI

Checks if the entity has an inventory (Horses, Camels, LLamas, …)
overload 1:
LivingEntityAPI:hasInventory()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.hasContainer

Inherited from EntityAPI

Checks if the entity has a container (Chest Boats, Minecarts with Chests, …)
overload 1:
LivingEntityAPI:hasContainer()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isSprinting

Inherited from EntityAPI

Returns true if this entity is currently sprinting
overload 1:
LivingEntityAPI:isSprinting()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getEyeY

Inherited from EntityAPI

Returns the Y level of this entity's eyes
Not to be confused with getEyeHeight,
this function also takes the entity itself's Y position into account
overload 1:
LivingEntityAPI:getEyeY()
Method Property Fluent Description Representation
Return Value a Number

LivingEntityAPI.isLiving

Inherited from EntityAPI

Gets if this entity is a Living Entity
overload 1:
LivingEntityAPI:isLiving()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.isPlayer

Inherited from EntityAPI

Gets if this entity is a Player Entity
overload 1:
LivingEntityAPI:isPlayer()
Method Property Fluent Description Representation
Return Value a Boolean

LivingEntityAPI.getTargetedEntity

Inherited from EntityAPI

Returns a proxy for your currently targeted Entity
This Entity appears on the F3 screen
Maximum and Default distance is 20,
Minimum is 0
overload 1:
LivingEntityAPI:getTargetedEntity()
Method Property Fluent Description Representation
Return Value a Varargs
overload 2:
LivingEntityAPI:getTargetedEntity(distance)
Method Property Fluent Description Representation
distance accepts a Number
Return Value a Varargs

LivingEntityAPI.getTargetedBlock

Inherited from EntityAPI

Returns a proxy for your currently targeted BlockState
This BlockState appears on the F3 screen
The maximum (and default) distance is 20,
minimum is -20
Returns the block, the hit position,
and the targeted block face as three separate values
overload 1:
LivingEntityAPI:getTargetedBlock()
Method Property Fluent Description Representation
Return Value a Varargs
overload 2:
LivingEntityAPI:getTargetedBlock(ignoreLiquids)
Method Property Fluent Description Representation
ignoreLiquids accepts a Boolean
Return Value a Varargs
overload 3:
LivingEntityAPI:getTargetedBlock(ignoreLiquids, distance)
Method Property Fluent Description Representation
ignoreLiquids accepts a Boolean
distance accepts a Number
Return Value a Varargs

LivingEntityAPI.getVariable

Inherited from EntityAPI

Gets the value of a variable this entity stored in themselves using the Avatar API's store() function
overload 1:
LivingEntityAPI:getVariable()
Method Property Fluent Description Representation
Return Value anything
overload 2:
LivingEntityAPI:getVariable(key)
Method Property Fluent Description Representation
key accepts a String
Return Value anything

LivingEntityAPI.getNbt

Inherited from EntityAPI

Gets a table containing the NBT of this entity
Please note that not all values in the entity's NBT may be synced,
as some are handled only on the server side
overload 1:
LivingEntityAPI:getNbt()
Method Property Fluent Description Representation
Return Value a table

LivingEntityAPI.getPermissionLevel

Inherited from EntityAPI

Returns the permission level number of this entity
Server Operators,
by default, have the permission level of 4
overload 1:
LivingEntityAPI:getPermissionLevel()
Method Property Fluent Description Representation
Return Value an Integer
a a