Minecraft:Entity format: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
== Directory structure == | == Directory structure == | ||
{{See also|World#Storage | {{See also|World#Storage}} | ||
<div class="treeview"> | <div class="treeview"> | ||
*{{File|directory|''world save directory''}} | *{{File|directory|''world save directory''}} | ||
**{{File|directory|entities}}: Contains entity files for the [[Minecraft:Overworld]]. These used to be part of region. | **{{File|directory|dimensions}} | ||
***{{File|file|r.<x>.<z>.mca}} | ***{{File|directory|minecraft}} | ||
**{{File|directory| | ****{{File|directory|overworld}} | ||
***{{File|directory|entities}} | *****{{File|directory|entities}}: Contains entity files for the [[Minecraft:Overworld]]. These used to be part of region. | ||
****{{File|file|r.<x>.<z>.mca}} | ******{{File|file|r.<x>.<z>.mca}} | ||
**{{File|directory| | ****{{File|directory|the_nether}} | ||
** | *****{{File|directory|entities}} | ||
****{{File|file|r.<x>.<z>.mca}} | ******{{File|file|r.<x>.<z>.mca}}: Contains entity files for the [[Minecraft:Nether]]. | ||
****{{File|directory|the_end}} | |||
*****{{File|directory|entities}}: Contains entity files for the [[Minecraft:End]]. | |||
******{{File|file|r.<x>.<z>.mca}} | |||
</div> | </div> | ||
| Line 22: | Line 25: | ||
An entity that inherits from an abstract class or other entity share their implementation and functionalities with each other, while an entity that inherits from an interface may not necessarily share its functionalities, rather implement the required behaviors from the interface itself. As such, an entity's implementation of the interface may be different from other entities. Any entity may implement multiple interfaces, while only inheriting a single abstract class or other entity. | An entity that inherits from an abstract class or other entity share their implementation and functionalities with each other, while an entity that inherits from an interface may not necessarily share its functionalities, rather implement the required behaviors from the interface itself. As such, an entity's implementation of the interface may be different from other entities. Any entity may implement multiple interfaces, while only inheriting a single abstract class or other entity. | ||
=== Abstract classes === | === Abstract classes === | ||
{{blist | {{blist | ||
| Line 43: | Line 45: | ||
}} | }} | ||
|Hanging Entity {{blist | |Hanging Entity {{blist | ||
|{{EntityLink|Cushion}}{{upcoming|java 26.3}} | |||
|{{EntityLink|Item Frame}} {{blist | |{{EntityLink|Item Frame}} {{blist | ||
|{{EntityLink|Glow Item Frame}} | |{{EntityLink|Glow Item Frame}} | ||
| Line 53: | Line 56: | ||
|collapse=1 | |collapse=1 | ||
|{{EntityLink|Armor Stand}} | |{{EntityLink|Armor Stand}} | ||
|{{ | |Avatar {{Blist | ||
|{{EntityLink|Player}} {{blist | |||
|Server Player | |||
|Abstract Client Player {{blist | |||
|Local Player | |||
|Remote Player | |||
}} | |||
}} | }} | ||
|{{EntityLink|Mannequin}} {{blist | |||
|Client Mannequin | |||
}} | |||
}} | }} | ||
|[[Minecraft:Mob]]{{#lst:Entity format|mob-class}} | |||
}} | |||
|{{Collapse | |{{Collapse | ||
|title=[[Minecraft:Projectile]] | |title=[[Minecraft:Projectile]] | ||
| Line 92: | Line 99: | ||
<section begin="mob-class"/>{{blist | <section begin="mob-class"/>{{blist | ||
|{{EntityLink|Ender Dragon}} | |{{EntityLink|Ender Dragon}} | ||
|{{EntityLink|Ghast}} | |||
|{{EntityLink|Phantom}} | |||
|Ambient Creature {{blist | |Ambient Creature {{blist | ||
|{{EntityLink|Bat}} | |{{EntityLink|Bat}} | ||
}} | }} | ||
|Pathfinder Mob {{blist | |Pathfinder Mob {{blist | ||
| Line 108: | Line 113: | ||
}} | }} | ||
|Ageable Mob {{blist | |Ageable Mob {{blist | ||
|AbstractCubeMob {{blist | |||
|{{EntityLink|Magma Cube}} | |||
|{{EntityLink|Slime}} | |||
|{{EntityLink|Sulfur Cube}} | |||
}} | |||
|Abstract Villager {{blist | |Abstract Villager {{blist | ||
|{{EntityLink|Villager}} | |{{EntityLink|Villager}} | ||
| Line 163: | Line 173: | ||
}} | }} | ||
}} | }} | ||
}} | |||
|{{blist | |||
|title=[[Minecraft:Monster]] | |title=[[Minecraft:Monster]] | ||
|collapse=1 | |collapse=1 | ||
| Line 217: | Line 227: | ||
}} | }} | ||
}} | }} | ||
|Water Animal {{blist | |||
|{{EntityLink|Dolphin}} | |{{EntityLink|Dolphin}} | ||
|Abstract Fish {{blist | |Abstract Fish {{blist | ||
| Line 232: | Line 243: | ||
}} | }} | ||
}} | }} | ||
}} | |||
}}<section end="mob-class"/> | }}<section end="mob-class"/> | ||
| Line 281: | Line 289: | ||
|content={{blist | |content={{blist | ||
|{{EntityLink|Axolotl}} | |{{EntityLink|Axolotl}} | ||
|{{EntityLink|Sulfur Cube}} | |||
|Abstract Fish {{blist | |Abstract Fish {{blist | ||
|{{EntityLink|Pufferfish}} | |{{EntityLink|Pufferfish}} | ||
| Line 740: | Line 749: | ||
{{collapse|title={{EntitySprite|area-effect-cloud|link=Lingering Potion|text='''area_effect_cloud'''}}|content={{#lst:Lingering Potion|entity data}}}} | {{collapse|title={{EntitySprite|area-effect-cloud|link=Lingering Potion|text='''area_effect_cloud'''}}|content={{#lst:Lingering Potion|entity data}}}} | ||
{{collapse|title={{EntitySprite|cushion|link=Cushion|text='''cushion'''}}|content={{#lst:Cushion|entity data}}}} | |||
{{collapse|title={{EntitySprite|end-crystal|link=End Crystal|text='''end_crystal'''}}|content={{#lst:End Crystal|entity data}}}} | {{collapse|title={{EntitySprite|end-crystal|link=End Crystal|text='''end_crystal'''}}|content={{#lst:End Crystal|entity data}}}} | ||
{{collapse|title={{EntitySprite|evoker-fangs|link=Evoker|text='''evoker_fangs'''}}|content={{#lst:Evoker|fang entity data}}}} | {{collapse|title={{EntitySprite|evoker-fangs|link=Evoker|text='''evoker_fangs'''}}|content={{#lst:Evoker|fang entity data}}}} | ||
| Line 779: | Line 789: | ||
|{{HistoryLine||1.21.5|dev=25w02a|The {{nbt|compound|ArmorDropChances}}, {{nbt|compound|HandDropChances}}, and {{nbt|compound|body_armor_drop_chance}} fields have been merged into a {{nbt|compound|drop_chances}} field. | |{{HistoryLine||1.21.5|dev=25w02a|The {{nbt|compound|ArmorDropChances}}, {{nbt|compound|HandDropChances}}, and {{nbt|compound|body_armor_drop_chance}} fields have been merged into a {{nbt|compound|drop_chances}} field. | ||
|Drop chances with a default value will no longer be stored, and the {{nbt|compound|drop_chances}} field is removed entirely if all defaults. | |Drop chances with a default value will no longer be stored, and the {{nbt|compound|drop_chances}} field is removed entirely if all defaults. | ||
|{{nbt|int-array|last_hurt_by_player}}, {{nbt|int|last_hurt_by_player_memory_time}}, {{nbt|int-array|last_hurt_by_mob}}, and {{nbt|int|ticks_since_last_hurt_by_mob}} added to living entities. | |||
|Area effect clouds have a new field: {{nbt|float|potion_duration_scale}}.}} | |Area effect clouds have a new field: {{nbt|float|potion_duration_scale}}.}} | ||
|{{HistoryLine|||dev=25w03a|The {{nbt|compound|ArmorItems}}, {{nbt|compound|HandItems}}, and {{nbt|compound|body_armor_item}} fields have been merged into an {{nbt|compound|equipment}} field.}} | |{{HistoryLine|||dev=25w03a|The {{nbt|compound|ArmorItems}}, {{nbt|compound|HandItems}}, and {{nbt|compound|body_armor_item}} fields have been merged into an {{nbt|compound|equipment}} field.}} | ||
| Line 797: | Line 808: | ||
|{{HistoryLine||26.1|dev=snap2|The {{cd|current_explosion_impact_pos}} and {{cd|current_impulse_context_reset_grace_time}} fields from players have been added to all mobs and the [[Minecraft:armor stand]]. | |{{HistoryLine||26.1|dev=snap2|The {{cd|current_explosion_impact_pos}} and {{cd|current_impulse_context_reset_grace_time}} fields from players have been added to all mobs and the [[Minecraft:armor stand]]. | ||
|The {{cd|ignore_fall_damage_from_current_explosion}} field on players has been removed.}} | |The {{cd|ignore_fall_damage_from_current_explosion}} field on players has been removed.}} | ||
|{{HistoryLine||26.2|dev=snap6|The {{cd|HurtByTimestamp}} field has been removed from the LivingEntity class; {{cd|ticks_since_last_hurt_by_mob}} should be used instead.}} | |||
|{{HistoryLine|java upcoming}} | |||
|{{HistoryLine||26.3|dev=snap6|Added {{cd|invulnerable_time}} tag which makes a mob temporarily invulnerable for a specific number of ticks.}} | |||
}} | }} | ||
Latest revision as of 11:14, 12 August 2026
Template:Exclusive
Entities are stored in the entities folder of respective dimension folders. It is stored like Minecraft Minecraft:Anvil format files, which are named in the form r.x.z.mca.
Directory structure
- Template:File
- Template:File
- Template:File
- Template:File
- Template:File: Contains entity files for the Minecraft:Overworld. These used to be part of region.
- Template:File
- Template:File
- Template:File: Contains entity files for the Minecraft:Nether.
- Template:File
- Template:File
- Template:File: Contains entity files for the Minecraft:End.
- Template:File
- Template:File
- Template:File
Entity inheritance
Most entities share similar functionalities with each other from abstract classes or interfaces. For instance, horses (and their undead variants), donkeys, camels, mules, and llamas all inherit from Abstract Horse, which share some of its horse-like behaviors and properties to their inheritance. This inheritance can be seen under the game's code for all of its entities.
An entity that inherits from an abstract class or other entity share their implementation and functionalities with each other, while an entity that inherits from an interface may not necessarily share its functionalities, rather implement the required behaviors from the interface itself. As such, an entity's implementation of the interface may be different from other entities. Any entity may implement multiple interfaces, while only inheriting a single abstract class or other entity.
Abstract classes
Interfaces
NBT structure
Every Minecraft:entity is an unnamed Template:Nbt compound contained in the Entities list of a chunk file. The sole exception is the Player entity, stored in level.dat, or in <player>.dat files on servers.
- Template:Nbt The root tag.
- Template:Nbt: Version of the chunk data.
- Template:Nbt: Position of this chunk.
- Template:Nbt: X coordinate.
- Template:Nbt: Z coordinate.
- Template:Nbt: All the entities. Each compound in this list defines an entity in this chunk.
- Template:Nbt: An entity. See #Entity format below.
Entity format
All entities are with the following structure:
- Template:Nbt Entity data
Mobs
Mobs are a subclass of Living Entity with additional tags to store their health, attacking/damaged state, potion effects, and more depending on the mob. Players and Minecraft:armor stands are a subclass of living entities.
Mob-specific data
Many mobs additionally have individual data.
Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:CollapseTemplate:CollapseTemplate:Collapse Template:Collapse
Projectiles
Projectiles are a subclass of Entity.
Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse
Items and XP Orbs
Items and XPOrbs are a subclass of Entity.
Template:Collapse Template:Collapse
Vehicles
Vehicles are subclasses of Entity.
Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse
Dynamic tiles
Dynamic tiles are a subclass of Entity and are used to simulate realistically moving blocks.
Template:Collapse Template:Collapse
Display
Display entities are subclasses of Entity.
Template:Collapse Template:Collapse Template:Collapse
Other
Other entity types that are a subclass of Entity but do not fit into any of the above categories.
Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse
History
References
Template:Navbox Java Edition technical
Minecraft:de:Objektdaten Minecraft:fr:Format d'entité Minecraft:ja:エンティティフォーマット Minecraft:ko:개체 형식 Minecraft:pt:Formato de entidade Minecraft:zh:实体数据格式