Minecraft:Entity
More actions
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Template:Relevant category Entities include all dynamic, moving objects throughout the Template:MC world.
General behavior
Properties all or most entities have are:
- A position, rotation, and velocity
- A Minecraft:bounding box consisting of one or more non-rotating, three-dimensional boxes with a fixed height and width
- The ability to be on Minecraft:fire, displayed as flames on or around the entity
- The ability to have a Minecraft:status effect, such as from Minecraft:potions
- A Minecraft:view point, even if it has no eyes
Most entities can be pushed around by Minecraft:water currents, and some can have their trajectory altered by Minecraft:explosions if already traveling at speed. Some entities can be renamed by Template:Control a Minecraft:name tag on them.
Most entities have a health status, including Minecraft:mobs, Minecraft:players, Minecraft:armor stands, Minecraft:boats, Minecraft:boat with chests, Minecraft:items, and Minecraft:minecarts. Moving blocks, shot or thrown projectiles, area effect clouds, and Minecraft:experience orbs do not have Minecraft:health.
Most entities collide with Minecraft:solid blocks, though some entities, like Minecraft:vexes, Minecraft:ender dragons and thrown eyes of ender, do not. Most types of entities prevent blocks from being placed in the space they occupy, except for dropped items and experience orbs, which are automatically pushed out of the block to open air. If a solid block enters an entity's space, such as falling Minecraft:sand or a swinging Minecraft:door, then it is free to move out of the solid block but not back in. For example, if a door is closed on the player, player can jump up and stand on top of the bottom-half door block, if there is air above the door.
Entities are lit according to the Minecraft:light level of the block their position is in. For example, if a Minecraft:minecart runs over a non-straight track directly into a solid block, it turns black because solid blocks always have a light level of 0; Minecraft:arrows are also sometimes seen to turn black, especially if fired shallowly into the ceiling; Minecraft:players Template:In sometimes also turn black when sleeping.
Immovable entities
Minecraft:Item frames, Minecraft:glow item frames, Minecraft:paintings, and Minecraft:leash knots, unlike most entities, align to the block grid, and are completely immobile.
Boats and minecarts
Boats, boats with chests and minecarts appear to recover health over time. For example, they can be broken by hitting them quickly, but cannot be destroyed by hits with unarmed hand with a pause after each hit. The amount of wobbling displayed by boats and minecarts when struck appears to indicate their current health. All minecart, boat and boat with chest variants have Template:Hp.
Gravity-affected blocks
Gravity-affected blocks include Minecraft:sand, Minecraft:gravel, Minecraft:anvils, Minecraft:red sand, Minecraft:dragon eggs, Minecraft:concrete powder, Minecraft:scaffolding, and Minecraft:pointed dripstone, along with Minecraft:snow layers Template:In.
A gravity-affected block normally exists as a block, but when its support is removed, it becomes a Minecraft:falling block entity and falls down until hitting the top surface of another block. If there is valid space, it places itself as a block at the nearest on-grid position, or drops as an item if that position is occupied by a block without a solid top surface, such as a Minecraft:torch or a bottom Minecraft:slab.
While a falling block ordinarily falls straight down, its trajectory can be affected by Minecraft:explosions, Minecraft:bubble columns, Minecraft:pistons, reeling it in, and moving Minecraft:slime blocks, and can slide down the side of Minecraft:honey blocks. It is also possible to modify the velocity and direction of a falling block by using Minecraft:commands such as Template:CmdTemplate:Only or third-party programs. A falling block despawns and drops as an item if it does not land after existing for 600 Minecraft:ticks (30 seconds), or 100 ticks (5 seconds) if falling into the Minecraft:voidTemplate:Verify.
If a cave generates underneath sand, gravel, or red sand, the blocks remain stationary until they receive a Minecraft:block update. If a single block is updated and falls down, neighboring blocks are updated in a chain reaction that can cause the collapse of an entire region of gravity-affected blocks.
Interactions with "use" control
Entities with Template:Control interactions (such as Minecraft:boats, Minecraft:boat with chests, Minecraft:minecarts, Minecraft:cats, Minecraft:villagers, tamed Minecraft:parrots, and tamed Minecraft:wolves) do not stop the Template:Control action of a tool the player is holding. For example, Template:Control a Minecraft:water bucket on a tamed wolf causes the wolf to sit, but also empties the bucket near or onto the wolf.
Riding
Entities can ride on, or be attached to, other entities. When this is the case, only the lower/"outer" entity's volume collides with other things, and only that entity can control movement.Template:Only However, there are exceptions: players riding Minecraft:minecarts, Minecraft:boats, Minecraft:boats with chests, saddled Minecraft:horses, a Minecraft:happy ghast, a Minecraft:nautilus, a Minecraft:donkey, a Minecraft:mule, a Minecraft:camel, or baby Minecraft:zombies riding Minecraft:chickens, or Minecraft:skeletons riding horses or boats.
The only current legitimate combinations of riding entities are:
- A Minecraft:mob or Minecraft:player in a Minecraft:minecart, Minecraft:boat or Minecraft:boat with chests.
- A boat or boat with chest in a minecartTemplate:Only<ref>Template:Bug</ref>.
- A player on a saddled Minecraft:pig, Minecraft:horse, Minecraft:donkey, Minecraft:mule, Minecraft:skeleton horse, Minecraft:zombie horse, Minecraft:llama, Minecraft:strider, Minecraft:camel, Minecraft:camel husk, Minecraft:nautilus or Minecraft:zombie nautilus.
- A player on a Minecraft:happy ghast with a Minecraft:harness.
- Any type of Minecraft:skeleton on a Minecraft:spider or Minecraft:cave spiderTemplate:Only; also known as a Minecraft:spider jockey.
- Any type of baby Minecraft:zombie or Minecraft:zombified piglinTemplate:Only on a Minecraft:chicken or other mobsTemplate:Only; also known as a Minecraft:chicken jockey.
- A Minecraft:drowned riding a zombie nautilus, known as a zombie nautilus jockey.
- Minecraft:Skeletons riding Minecraft:skeleton horses.
- Minecraft:Pillager, Minecraft:vindicator, or Minecraft:evoker riding a Minecraft:ravager.
- Baby Minecraft:piglin, riding a baby Minecraft:hoglin.
- Baby piglin, riding a baby piglin on a baby hoglin.
- Baby piglin, riding a baby piglin, riding a baby piglin on a baby hoglin.
- A Minecraft:strider, riding another strider.
- Minecraft:Zombified piglin riding a strider.
- A Minecraft:villager or a Minecraft:witch riding a Minecraft:chicken (this is feasible by curing a baby Minecraft:zombie villager Minecraft:chicken jockey, and then potentially turning the villager into a witch using a Minecraft:lightning bolt)
- A player riding a zombified piglin (by turning a ridden Minecraft:pig into a zombified piglin using a lightning bolt)
A Minecraft:parrot perched on Minecraft:player's shoulder isn't considered as riding.
It is possible to have even more levels, such as a baby Minecraft:piglin on another baby piglin who is riding a Minecraft:hoglin in a Minecraft:boat in a Minecraft:minecart.
Entities can also be stacked on top of each other with the use of the Template:Cmd and Template:Cmd commands Template:In. For example, using Template:Cmd summons a Minecraft:spider jockey, or using Template:Cmd Template:In.
If an entity is riding another entity, the top entity cannot teleport because as soon as the teleport is made, the entity is teleported back to riding the other entity.Template:Only
Starting from the Minecraft:Nether Update, entities that are riders or passengers of other entities cannot Minecraft:despawn.Template:VerifyTemplate:Only
Appearance
Template:MainThe textures on the surfaces of entities usually integrate images applied to all parts of an entity into one single file, similar to player Minecraft:skins. The heights and widths of objects inside the texture file are typically multiplies of 60px. Each entity renders the texture in different three-dimensional models, and all entities have Minecraft:animations rendered with the model.
With Minecraft:Vibrant Visuals, the game uses multiple texture files on top of the color textures, which affects how light and reflections behave on the surface. The MERS texture map is used to define per pixel how metallic (reflects all light), emissive (produces its own light), or rough (absorbs all light) it is, with an additional subsurface scattering map (how light is scattered on the surface) which can replace metalness. With resource packs, other texture maps are also used, including normal and heightmaps. These change depth of the entity, and can add multiple 3D effects.
Using Minecraft:resource packs, the player can change the textures of entities. They can also change the shapes and animations of entities using Minecraft:models.
Types of entities
The table below lists types of entities that currently exist in Minecraft.
Entities listed as "solid" obstruct the passage of other entities.
<references group="health />
Motion
Template:RedirectGravity works differently in Minecraft than the real world, as not everything is subject to the same acceleration. Additionally, there is a drag force proportional to velocity, again dependent on the entity.
In general, entities perform 3 operations to calculate movement each tick:
- Apply acceleration: Add acceleration to the current velocity (for most entities, the only acceleration is gravity),
- Apply drag: Multiply the current velocity by a drag coefficient (which may be different for the horizontal and vertical components),
- Update position: Add the current velocity to the current position.
Different entities perform these operations in different orders within the tick, which changes their behavior. For example, a living entity in the air is described by the following code each tick: <syntaxhighlight lang="java"> // Update position position.x += velocity.x; position.y += velocity.y; position.z += velocity.z;
// Update acceleration velocity.y -= 0.08D;
// Update drag velocity.x *= 0.91F; velocity.y *= 0.98F; velocity.z *= 0.91F; </syntaxhighlight> Just substituting the correct values for acceleration and drag and ordering the three operations correctly is enough to exactly simulate any entity listed below.
<section begin="tableheader"/>
| Kind | Ticking order | Gravity<ref group="note" name="boom">Explosive projectiles and wind charges are not affected by gravity but instead get acceleration from getting damaged.</ref>
(m/tick/tick) |
Drag
(vertical) |
Drag
(horizontal) |
Terminal velocity
(m/tick)<ref group="note">Terminal velocity is given by <math>\frac{\text{acceleration}}{1-\text{drag}}</math> if drag is before acceleration and <math>\frac{\text{drag }\times\text{ acceleration}}{1-\text{drag}}</math> otherwise.</ref> |
Terminal velocity
(m/s) |
Maximum horizontal travel distance
(m/(m/s))<ref group="note">For axes with no acceleration, maximum travel distance is given by <math>\frac{\text{initialVelocity}}{1-\text{drag}}</math> if position is before drag and <math>\frac{\text{drag }\times\text{ initialVelocity}}{1-\text{drag}}</math> otherwise. Table values are the number that, when multiplied by the initial velocity, gives the maximum travel distance.</ref> <section end="tableheader"/> |
|---|---|---|---|---|---|---|---|
| Template:EntitySprite Template:EnvSprite Template:EntitySprite Players and other living entities | Position, Acceleration, Drag | -0.08 (double) | 0.98 (float) | 0.91 (float)<ref group="note">Players, mobs and armor stands whose OnGround property is set to 1 have a horizontal drag coefficient of <math>0.91 \times \text{friction}</math>. Friction is 0.6 by default, 0.8 for Slime Blocks, 0.98 for Minecraft:Ice, Minecraft:Packed Ice and Minecraft:Frosted Ice, and 0.989 for Minecraft:Blue Ice.</ref> | 3.92 | 78.4 | 11.111 |
| Players/mobs with Template:EffectLink | -0.01 (double)
|
0.49 | 9.80 | 11.111 | |||
| Template:EntitySprite Template:EntitySprite Minecraft:Falling blocks and Minecraft:TNT | Acceleration, Position, Drag | -0.04 (double) | 0.98 (double) | 1.96 | 39.2 | 50 | |
| Template:EntityLink | -0.04 (double) | 0.98 (double) | 0.98 (float) | 1.96 | 39.2 | 50 | |
| Template:EntityLink | -0.03 (double) | 0.98 (float) | 1.47 | 29.4 | 50 | ||
| Template:EntityLink<ref group="note">Minecarts have a maximum horizontal velocity of 0.4. Any greater value is reset to that number before updating the position.</ref> | -0.04 (double) | 0.95 (double) | 0.76 | 15.2 | 20 | ||
| Template:EntitySprite Thrown fishing bobbers | -0.03 (double) | 0.92 (double) | 0.345 | 6.90 | 12.5 | ||
| Template:ItemSprite Template:ItemSprite Minecraft:Boats and chest boats | Acceleration, Drag, Position | -0.04 (double) | N/A<ref name="nodrag" group="note"/> | 0.90 (float)Template:Only/ | ∞ | ∞ | 9
<section begin="projectiles"/> |
| Template:EntitySprite Template:EntitySprite Template:EntitySprite Thrown Minecraft:eggs, Minecraft:snowballs, and Minecraft:ender pearls | Acceleration, Drag, Position<ref name="1.21.2thrownProjectile" group="note">The order of throwable projectiles was changed in Minecraft:Java Edition 1.21.2, from "Position, Drag, Acceleration" to "Acceleration, Drag, Position".</ref> | -0.03 (double) | 0.99 (float) | 0.99 (float) | 2.97 | 59.4 | 99 |
| Template:EntitySprite Thrown Minecraft:potions | -0.05 (double)
|
4.95 | 99.0 | ||||
| Template:EntitySprite Thrown Minecraft:bottles o' enchanting | -0.07 (double)
|
6.93 | 138.6 | ||||
| Template:EntitySprite Template:EntitySprite Template:EntitySprite Minecraft:Fireballs, Minecraft:small fireballs, wither skulls, and Minecraft:dragon fireballs | Acceleration, Drag, Position | 0.10 (double)<ref group="note" name="boom"/> | 0.95 (float) | 1.90 | 38.0 | 19 | |
| Template:EntityLink | 0.10 (double)<ref group="note" name="boom"/> | 0.73 (float) | 0.2703703 | 5.407407 | 2.703703 | ||
| Template:EntityLink | 0.10 (double)<ref name="boom" group="note" /> | N/A<ref name="nodrag" group="note">For boats and wind charges, the order between acceleration and drag doesn't matter: Boats have no vertical drag, and wind charges have no drag at all.</ref> | ∞ | ∞ | ∞ | ||
| Template:EntityLink | Position, Drag, Acceleration | -0.06 (double) | 0.99 (float) | 6.00 | 120.0 | 100 | |
| Template:EntitySprite Template:EntitySprite Fired Minecraft:arrows, and thrown Minecraft:tridents | -0.05 (double) | 0.99 (float) | 5.00 | 100.0 | 100
<section end="projectiles"/> | ||
Formulas
It can be useful to have a closed-form formula for and entity's position and velocity. These are not exact like a program would be, because the in-game movement is subject to floating-point rounding errors and mathematical formulas are not. A detailed explanation of how these formulas were derived can be found here.
Velocity
Applying an initial velocity <math display="inline">\text{initialVelocity}</math> on an entity, the entity's velocity after travelling for a number of ticks <math display="inline">\text{ticksPassed}</math> can be given by the formulas:
- Drag applied before acceleration:
- <math>\text{finalVelocity} = \text{drag}^\text{ticksPassed} \times \left(\text{initialVelocity} - \frac{\text{acceleration}}{1-\text{drag}}\right) + \frac{\text{acceleration}}{1-\text{drag}}</math>
- Drag applied after acceleration <ref group="note" name="drag">For entities where the acceleration is applied before drag, the effective acceleration is the acceleration scaled by the drag coefficient; this is why their terminal velocities aren't whole numbers while the others are.</ref>:
- <math>\text{finalVelocity} = \text{drag}^\text{ticksPassed} \times \left(\text{initialVelocity} - \frac{\text{drag }\times\text{ acceleration}}{1-\text{drag}}\right) + \frac{\text{drag }\times\text{ acceleration}}{1-\text{drag}}</math>
Initial velocity and acceleration should be interpreted as vectors, and drag as a diagonal matrix. This means that the formulas work for each X, Y, and Z component separately if drag, initialVelocity, and acceleration are replaced with their corresponding X, Y, or Z components.
Position
Here <math>d</math> is drag, <math>a</math> is acceleration, <math>t</math> is ticksPassed, and <math>v_0</math> is initialVelocity. Then an entity starting at <math>\text{initialPosition}</math> will end at a <math>\text{finalPosition}</math> given by:
- Position, Drag, Acceleration:
- <math>\text{finalPosition} = \text{initialPosition}+\frac{1-d^{t}}{1-d}\left(v_0-\frac{1}{1-d}a\right)+\frac{t}{1-d}a</math>
- Position, Acceleration, Drag:
- <math>\text{finalPosition} = \text{initialPosition}+\frac{1-d^{t}}{1-d}\left(v_0-\frac{d}{1-d}a\right)+\frac{dt}{1-d}a</math>
- Acceleration, Position, Drag:
- <math>\text{finalPosition} = \text{initialPosition}+\frac{1-d^{t}}{1-d}\left(v_0-\frac{d}{1-d}a\right)+\frac{t}{1-d}a</math>
- Drag, Acceleration, Position:
- <math>\text{finalPosition} = \text{initialPosition}+\frac{d\left(1-d^{t}\right)}{1-d}\left(v_0-\frac{1}{1-d}a\right)+\frac{t}{1-d}a</math>
- Drag, Position, Acceleration<ref group="note">No entity has "Drag, Position, Acceleration" order but the formula is included for completeness.</ref>:
- <math>\text{finalPosition} = \text{initialPosition}+\frac{d\left(1-d^{t}\right)}{1-d}\left(v_0-\frac{1}{1-d}a\right)+\frac{dt}{1-d}a</math>
- Acceleration, Drag, Position:
- <math>\text{finalPosition} = \text{initialPosition}+\frac{d\left(1-d^{t}\right)}{1-d}\left(v_0-\frac{d}{1-d}a\right)+\frac{dt}{1-d}a</math>
Like before, initial position, initial velocity and acceleration should be treated as vectors and drag as a diagonal matrix. Template:Notelist
Calculator
Data values
Java Edition
- Template:Nbt: Root tag.
Bedrock Edition
Videos
History
Java Edition
Bedrock Edition
Legacy Console Edition
Trivia
- When an entity is moving away from its block radius, the solid block can be placed but it does not emit a place sound effect or the player's placing animation.Template:Only
- Template:In however, the block place sound effect can be played and emitted and the player's placing animation plays but it does not when using a controller or keyboard and mouse connection.
Issues
See also
- Minecraft:Block entity – unlike the entities mentioned above, these are simply blocks that store additional data.
References
External links
- MinecraftMotionTools – a GitHub repository with some in-depth explanation about motion in-game.
Template:Navbox entities Template:Navbox environment
Minecraft:cs:Subjekt Minecraft:de:Objekt Minecraft:es:Entidad Minecraft:fr:Entité Minecraft:hu:Entitás Minecraft:it:Entità Minecraft:ja:エンティティ Minecraft:ko:개체 Minecraft:lzh:實體 Minecraft:nl:Entiteit Minecraft:pl:Byty Minecraft:pt:Entidade Minecraft:ru:Сущность Minecraft:th:เอนทิตี้ Minecraft:uk:Сутність Minecraft:zh:实体