Entities
Page for all Entity objects.
Entity
Base object for all entities in the world.
Type | Name | Description | Signature |
---|---|---|---|
field | prevPosX | Last tick X position | double |
field | prevPosY | Last tick Y position | double |
field | prevPosZ | Last tick Z position | double |
field | posX | Current X position in the world | double |
field | posY | Current Y position in the world | double |
field | posZ | Current Z position in the world | double |
field | motionX | Entity motion X | double |
field | motionY | Entity motion Y | double |
field | motionZ | Entity motion Z | double |
field | rotationYaw | Yaw angle rotation (left-right) | float |
field | rotationPitch | Pitch angle rotation (up-down) | float |
field | prevRotationYaw | Last tick yaw rotation | float |
field | prevRotationPitch | Last tick pitch rotation | float |
field | onGround | Whether the entity is on ground | boolean |
field | isDead | Whether the entity is dead | boolean |
field | fallDistance | Entity fall distance | int |
field | ticksExisted | Ticks elapsed since entity spawn | int |
field | hurtResistantTime | Remaining time an entity will be immune to further damage after being hurt | int |
field | lastTickPosX | Same as prevPosX, but used for rendering | double |
field | lastTickPosY | Same as prevPosY, but used for rendering | double |
field | lastTickPosZ | Same as prevPosZ, but used for rendering | double |
function | getDisplayName | Returns the entity's display name | IChatComponent() |
function | getName | Returns the entity's name | string() |
function | getEyeHeight | Returns the entity's eye position | float() |
function | getDistanceToEntity | Returns distance to another entity from this entity | float(Entity) |
function | getDistanceSqToCenter | Returns squared distance to block center | double(BlockPos) |
function | isInWeb | Returns true if the entity is in a web | boolean() |
function | isInWater | Returns true if the entity is in water | boolean() |
function | isInLava | Returns true if the entity is in lava | boolean() |
function | isRiding | Returns true if the entity is riding another entity | boolean() |
function | isInvisible | Returns true if the entity is invisible | boolean() |
function | isSprinting | Returns true if the entity is sprinting | boolean() |
function | isSneaking | Returns true if the entity is sneaking | boolean() |
EntityLivingBase
Represents living entities in the world.
Inherits Entity.
If an Object inherits a different Object, it will also inherit its properties.
Type | Name | Description | Signature |
---|---|---|---|
field | rotationYawHead | Entity's yaw head rotation | float |
field | rotationPitchHead | Entity's pitch head rotation | float |
field | prevRotationYawHead | Last tick yaw head rotation | float |
field | prevRotationPitchHead | Last tick pitch head rotation | float |
field | hurtTime | Amount of ticks remaining until this entity will no longer act 'hurt' (starts at 10 when damaged) | int |
field | moveStrafing | Left/right movement factor | float |
field | moveForward | Forward/backward movement factor | float |
field | jumpMovementFactor | Forward movement jump multiplier | float |
function | getHealth | Returns the entity's health | double() |
function | getMaxHealth | Returns the entity's maximum health | double() |
function | getHeldItem | Returns the item that the entity is holding. null if not present | ItemStack() |
function | getInventory | Returns the entity's inventory items | ItemStack[]() |
function | isOnSameTeam | Whether the other entity is on the same team as this entity | boolean(EntityLivingBase) |
function | getTotalArmorValue | Returns the entity's armor value | int() |
function | getEntityBoundingBox | Returns the entity's bounding box | AxisAlignedBB() |
EntityPlayer
Represents Player entities in the world.
Inherits EntityLivingBase.
Type | Name | Description | Signature |
---|---|---|---|
field | capabilities | Player Capabilities states | PlayerCapabilities |
function | isUsingItem | Whether the entity is using an item | boolean() |
function | getItemInUseDuration | Returns an amount of ticks since the item was started being used | int() |
function | stopUsingItem | Stops item use | void() |
function | clearItemInUse | Resets in use states and duration | void() |
function | isBlocking | Whether the entity is blocking with their sword | boolean() |
function | dropOneItem | Drops the current held item. (args: all) | void(boolean) |
function | getToolDigEfficiency | Returns the held item's dig efficiency for a block | float(Block) |
function | canHarvestBlock | Whether this entity can harvest the block | boolean(Block) |
function | canAttackPlayer | Whether this entity can attack the player | boolean(EntityPlayer) |
function | getTotalArmorValue | Returns the total armor value for this entity | int() |
function | getCurrentEquippedItem | Returns the held item from inventory | ItemStack() |
function | jump | Set jump motion for this entity | void() |
PlayerCapabilities
Type | Name | Description | Signature |
---|---|---|---|
field | allowEdit | Indicates whether the player is allowed to modify the surroundings | boolean |
field | allowFlying | Whether or not to allow the player to fly when they double jump | boolean |
field | flySpeed | Player fly speed | float |
field | walkSpeed | Player walk speed | float |
field | disableDamage | Whether the player can be damaged | boolean |
field | isCreativeMode | Whether creative mode is enabled | boolean |
field | isFlying | Whether the player is flying | boolean |
EntityPlayerSP
Represents the player playing the game.
Inherits EntityPlayer.
Type | Name | Description | Signature |
---|---|---|---|
field | movementInput | Player's movement input |
MovementInput
Type | Name | Description | Signature |
---|---|---|---|
field | moveStrafe | The speed at which the player is strafing. Left - positive, right - negative | float |
field | moveForward | The speed at which the player is moving forward. Forward - positive, backward - negative | float |
field | jump | Whether the player is jumping | boolean |
field | sneak | Whether the player is sneaking | boolean |
Last updated