Minecraft:Entity: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
[[File:Entity Scaling.png|thumb|The size of six entities (a [[chicken]], a [[Minecraft:player]], an [[Minecraft:evoker]], a [[Minecraft:camel]], a [[Minecraft:warden]], and an [[Minecraft:oak boat]]) relative to four blocks]] | [[File:Entity Scaling.png|thumb|The size of six entities (a [[chicken]], a [[Minecraft:player]], an [[Minecraft:evoker]], a [[Minecraft:camel]], a [[Minecraft:warden]], and an [[Minecraft:oak boat]]) relative to four blocks]] | ||
{{Relevant category|Entities}} | {{Relevant category|Entities}} | ||
'''Entities''' include all dynamic | '''Entities''' include all dynamic objects throughout the {{MC}} world. | ||
== General behavior == | == General behavior == | ||
| Line 15: | Line 15: | ||
Most entities have a health status, including [[Minecraft:mob]]s, [[Minecraft:player]]s, [[Minecraft:armor stand]]s, [[Minecraft:boat]]s, [[Minecraft:boat with chest]]s, [[Minecraft:item]]s, and [[Minecraft:minecart]]s. Moving blocks, shot or thrown projectiles, area effect clouds, and [[Minecraft:experience orb]]s do not have [[Minecraft:health]]. | Most entities have a health status, including [[Minecraft:mob]]s, [[Minecraft:player]]s, [[Minecraft:armor stand]]s, [[Minecraft:boat]]s, [[Minecraft:boat with chest]]s, [[Minecraft:item]]s, and [[Minecraft:minecart]]s. Moving blocks, shot or thrown projectiles, area effect clouds, and [[Minecraft:experience orb]]s do not have [[Minecraft:health]]. | ||
Most entities collide with [[Minecraft:solid block]]s, though some entities, like [[Minecraft:vex]]es, [[Minecraft:ender dragon]]s and thrown [[Minecraft:Eye of Ender|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 | Most entities collide with [[Minecraft:solid block]]s, though some entities, like [[Minecraft:vex]]es, [[Minecraft:ender dragon]]s and thrown [[Minecraft:Eye of Ender|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 falling gravel falls on the player, the player will be able to move through the gravel until they suffocate or leave the block. | ||
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:arrow]]s are also sometimes seen to turn black, especially if fired shallowly into the ceiling; [[Minecraft:player]]s {{in|BE}} sometimes also turn black when sleeping. | 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:arrow]]s are also sometimes seen to turn black, especially if fired shallowly into the ceiling; [[Minecraft:player]]s {{in|BE}} sometimes also turn black when sleeping. | ||
=== Immovable entities === | === Immovable entities === | ||
[[Minecraft:Item frame]]s, [[Minecraft:glow item frame]]s, [[Minecraft:painting]]s, | [[Minecraft:Item frame]]s, [[Minecraft:glow item frame]]s, [[Minecraft:painting]]s, [[Minecraft:leash knot]]s, and [[Minecraft:Cushion|cushions]] unlike most entities, align to the block grid, and are completely immobile, meaning they can't be moved. | ||
=== Boats and minecarts === | === Boats and minecarts === | ||
| Line 49: | Line 49: | ||
The only current legitimate combinations of riding entities are: | 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 chest]] | * A [[Minecraft:mob]] or [[Minecraft:player]] in a [[Minecraft:minecart]], [[Minecraft:boat]] or [[Minecraft:boat with chest]]. | ||
* A boat or boat with chest in a minecart{{only|Java}}<ref>{{bug|MC-113871}}</ref>. | * A boat or boat with chest in a minecart{{only|Java}}<ref>{{bug|MC-113871}}</ref>. | ||
* A player | * A player riding 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 | * A player riding a [[Minecraft:happy ghast]] with a [[Minecraft:harness]]. | ||
* Any type of [[Minecraft:skeleton]] | * Any type of [[Minecraft:skeleton]] riding a [[Minecraft:spider]] or [[Minecraft:cave spider]]{{only|bedrock}}; known as a [[Minecraft:spider jockey]]. | ||
* Any type of baby [[Minecraft:zombie]] or [[Minecraft:zombified piglin]]{{only|java}} | * Any type of baby [[Minecraft:zombie]] or [[Minecraft:zombified piglin]]{{only|java}} riding a [[Minecraft:chicken]] or other mobs{{only|bedrock}}; known as a [[Minecraft:chicken jockey]]. | ||
* A [[Minecraft:drowned]] riding a zombie nautilus | * A skeleton riding a skeleton horse; known as a [[Minecraft:skeleton horseman]]. | ||
* [[Minecraft: | * A zombie wielding an [[Minecraft:iron spear]] riding a zombie horse; known as a [[Minecraft:zombie horseman]]. | ||
* [[Minecraft: | * A [[Minecraft:drowned]] wielding a [[Minecraft:trident]] riding a zombie nautilus; known as a [[Minecraft:zombie nautilus jockey]]. | ||
* | * A [[Minecraft:husk]] wielding an iron spear and a [[Minecraft:parched]] riding a camel husk; known as a [[Minecraft:camel husk jockey]]. | ||
* | * A [[Minecraft:pillager]], [[Minecraft:vindicator]], or [[Minecraft:evoker]] riding a [[Minecraft:ravager]]; known as a [[Minecraft:ravager jockey]]. | ||
* | * A baby [[Minecraft:piglin]] riding a baby [[Minecraft:hoglin]]; known as a [[Minecraft:hoglin jockey]].. | ||
* A | ** A baby piglin riding a baby piglin riding a baby hoglin. | ||
* [[Minecraft: | *** A baby piglin riding a baby piglin riding a baby piglin riding a baby hoglin. | ||
* A [[Minecraft:villager]] or a [[Minecraft:witch]] riding a | * A baby strider riding an adult strider. | ||
* A zombified piglin wielding a [[Minecraft:warped fungus on a stick]] riding a strider; known as a [[Minecraft:strider jockey]].. | |||
* A [[Minecraft:villager]] or a [[Minecraft:witch]] riding a 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 player riding a zombified piglin (by turning a ridden [[Minecraft:pig]] into a zombified piglin using a lightning bolt) | ||
| Line 149: | Line 151: | ||
{{Health|40}} ([[Minecraft:Bedrock Edition|''Bedrock Edition'']]) | {{Health|40}} ([[Minecraft:Bedrock Edition|''Bedrock Edition'']]) | ||
| {{tc|no}} | |||
|- | |||
! {{EntityLink|Cushion}}{{upcoming|java 26.3|bedrock 26.40}} | |||
| {{tc|yes}} | |||
| ∞ | |||
| {{tc|no}} | | {{tc|no}} | ||
|- | |- | ||
| Line 243: | Line 250: | ||
! [[Minecraft:Location Pointer Idle]]{{only|bedrock|short=1}}{{note|name=Editor|Only available in ''[[Minecraft:Bedrock Editor]]''.}} | ! [[Minecraft:Location Pointer Idle]]{{only|bedrock|short=1}}{{note|name=Editor|Only available in ''[[Minecraft:Bedrock Editor]]''.}} | ||
| {{tc|no}} | | {{tc|no}} | ||
| | | rowspan="3" | {{hp|20}} | ||
| {{tc|no}} | | {{tc|no}} | ||
|- | |- | ||
! [[Minecraft:Location Pointer Selected]]{{only|bedrock|short=1}}{{note|name=Editor}} | ! [[Minecraft:Location Pointer Selected]]{{only|bedrock|short=1}}{{note|name=Editor}} | ||
| {{tc|no}} | | {{tc|no}} | ||
| {{tc|no}} | | {{tc|no}} | ||
|- | |- | ||
! [[Minecraft:Map Marker]]{{only|bedrock|short=1}}{{note|name=Editor}} | ! [[Minecraft:Map Marker]]{{only|bedrock|short=1}}{{note|name=Editor}} | ||
| {{tc|no}} | | {{tc|no}} | ||
| {{tc|no}} | | {{tc|no}} | ||
|- | |- | ||
| Line 303: | Line 308: | ||
! [[Minecraft:Ruler]]{{only|bedrock|short=1}}{{note|name=Editor}} | ! [[Minecraft:Ruler]]{{only|bedrock|short=1}}{{note|name=Editor}} | ||
| {{tc|no}} | | {{tc|no}} | ||
| | | rowspan="2" | {{hp|20}} | ||
| {{tc|no}} | | {{tc|no}} | ||
|- | |- | ||
! [[Minecraft:Ruler Idle]]{{only|bedrock|short=1}}{{note|name=Editor}} | ! [[Minecraft:Ruler Idle]]{{only|bedrock|short=1}}{{note|name=Editor}} | ||
| {{tc|no}} | | {{tc|no}} | ||
| {{tc|no}} | | {{tc|no}} | ||
|- | |- | ||
| Line 588: | Line 592: | ||
=== ''Java Edition'' === | === ''Java Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|| | |{{HistoryLine|java pre-classic}} | ||
|{{HistoryLine||rd-132328|Added entities.}} | |||
|{{HistoryLine|Java Infdev}} | |{{HistoryLine|Java Infdev}} | ||
|{{HistoryLine||20100227-1414|Removed entities.}} | |{{HistoryLine||20100227-1414|Removed entities.}} | ||
|{{HistoryLine||20100316|Reimplemented entities.}} | |{{HistoryLine||20100316|Reimplemented entities.}} | ||
|{{HistoryLine|java}} | |{{HistoryLine|java}} | ||
|{{HistoryLine||1.2.1|dev=12w06a|Players can no longer | |{{HistoryLine||1.2.1|dev=12w06a|Players can no longer interact with entities through blocks in [[Minecraft:Creative]] mode.}} | ||
|{{HistoryLine||1.4.2|dev=12w34a|Entities can now use portals.}} | |{{HistoryLine||1.4.2|dev=12w34a|Entities can now use portals.}} | ||
|{{HistoryLine||1.9|dev=15w31a|Projectile motion has now been changed slightly.<ref>https://www.reddit.com/r/Minecraft/comments/3f7m2y/minecraft_snowball_projectile_changes_snapshot/</ref>}} | |{{HistoryLine||1.9|dev=15w31a|Projectile motion has now been changed slightly.<ref>https://www.reddit.com/r/Minecraft/comments/3f7m2y/minecraft_snowball_projectile_changes_snapshot/</ref>}} | ||
Latest revision as of 11:05, 26 July 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Template:Relevant category Entities include all dynamic 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 falling gravel falls on the player, the player will be able to move through the gravel until they suffocate or leave the block.
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, Minecraft:leash knots, and cushions unlike most entities, align to the block grid, and are completely immobile, meaning they can't be moved.
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 chest.
- A boat or boat with chest in a minecartTemplate:Only<ref>Template:Bug</ref>.
- A player riding 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 riding a Minecraft:happy ghast with a Minecraft:harness.
- Any type of Minecraft:skeleton riding a Minecraft:spider or Minecraft:cave spiderTemplate:Only; known as a Minecraft:spider jockey.
- Any type of baby Minecraft:zombie or Minecraft:zombified piglinTemplate:Only riding a Minecraft:chicken or other mobsTemplate:Only; known as a Minecraft:chicken jockey.
- A skeleton riding a skeleton horse; known as a Minecraft:skeleton horseman.
- A zombie wielding an Minecraft:iron spear riding a zombie horse; known as a Minecraft:zombie horseman.
- A Minecraft:drowned wielding a Minecraft:trident riding a zombie nautilus; known as a Minecraft:zombie nautilus jockey.
- A Minecraft:husk wielding an iron spear and a Minecraft:parched riding a camel husk; known as a Minecraft:camel husk jockey.
- A Minecraft:pillager, Minecraft:vindicator, or Minecraft:evoker riding a Minecraft:ravager; known as a Minecraft:ravager jockey.
- A baby Minecraft:piglin riding a baby Minecraft:hoglin; known as a Minecraft:hoglin jockey..
- A baby piglin riding a baby piglin riding a baby hoglin.
- A baby piglin riding a baby piglin riding a baby piglin riding a baby hoglin.
- A baby piglin riding a baby piglin riding a baby hoglin.
- A baby strider riding an adult strider.
- A zombified piglin wielding a Minecraft:warped fungus on a stick riding a strider; known as a Minecraft:strider jockey..
- A Minecraft:villager or a Minecraft:witch riding a 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:实体