LivingEntityAPI

subclasses EntityAPI

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

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.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.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.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.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.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.getStatusEffects

figura.docs.living_entity.get_status_effects
overload 1:
LivingEntityAPI:getStatusEffects()
Method Property Fluent Description Representation
Return Value a table

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.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.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.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.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.getArmor

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

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.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.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.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.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.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.getFireTicks

Inherited from EntityAPI

figura.docs.entity.get_fire_ticks
overload 1:
LivingEntityAPI:getFireTicks()
Method Property Fluent Description Representation
Return Value an Integer

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.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.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.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.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.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.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.getAir

Inherited from EntityAPI

figura.docs.entity.get_air
overload 1:
LivingEntityAPI:getAir()
Method Property Fluent Description Representation
Return Value an Integer

LivingEntityAPI.isHamburger

Inherited from EntityAPI

figura.docs.entity.is_hamburger
overload 1:
LivingEntityAPI:isHamburger()
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.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.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.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.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.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.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.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.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.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.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.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.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.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.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 BlockState
overload 2:
LivingEntityAPI:getTargetedBlock(ignoreLiquids)
Method Property Fluent Description Representation
ignoreLiquids accepts a Boolean
Return Value a BlockState
overload 3:
LivingEntityAPI:getTargetedBlock(ignoreLiquids, distance)
Method Property Fluent Description Representation
ignoreLiquids accepts a Boolean
distance accepts a Number
Return Value a BlockState

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(key)
Method Property Fluent Description Representation
key accepts a String
Return Value anything

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
a a