Minecraft:Mob variant definitions: Difference between revisions
More actions
Sync: new page from Minecraft |
Sync: updated from Minecraft |
||
| Line 2: | Line 2: | ||
'''Mob variants''' are variants of [[Minecraft:mob]]s. They define the assets and models used and define the conditions in which this variant spawns. | '''Mob variants''' are variants of [[Minecraft:mob]]s. They define the assets and models used and define the conditions in which this variant spawns. | ||
'''Mob sound variants''' are sound variants distinct from regular variants. They define sounds used by this sound variant. | |||
== Definition == | == Definition == | ||
Mob variants can be defined in [[Minecraft:data pack]]s, as part of the directory structure below. | Mob variants can be defined in [[Minecraft:data pack]]s, as part of the directory structure below. | ||
| Line 13: | Line 14: | ||
***{{File|directory|''namespace''}} | ***{{File|directory|''namespace''}} | ||
****{{File|directory|'''cat_variant'''}} | ****{{File|directory|'''cat_variant'''}} | ||
*****{{File|file|'''{{ph|name}}.json'''}} | |||
****{{File|directory|'''cat_sound_variant'''}} | |||
*****{{File|file|'''{{ph|name}}.json'''}} | *****{{File|file|'''{{ph|name}}.json'''}} | ||
****{{File|directory|'''chicken_variant'''}} | ****{{File|directory|'''chicken_variant'''}} | ||
*****{{File|file|'''{{ph|name}}.json'''}} | |||
****{{File|directory|'''chicken_sound_variant'''}} | |||
*****{{File|file|'''{{ph|name}}.json'''}} | *****{{File|file|'''{{ph|name}}.json'''}} | ||
****{{File|directory|'''cow_variant'''}} | ****{{File|directory|'''cow_variant'''}} | ||
*****{{File|file|'''{{ph|name}}.json'''}} | |||
****{{File|directory|'''cow_sound_variant'''}} | |||
*****{{File|file|'''{{ph|name}}.json'''}} | *****{{File|file|'''{{ph|name}}.json'''}} | ||
****{{File|directory|'''frog_variant'''}} | ****{{File|directory|'''frog_variant'''}} | ||
*****{{File|file|'''{{ph|name}}.json'''}} | *****{{File|file|'''{{ph|name}}.json'''}} | ||
****{{File|directory|'''pig_variant'''}} | ****{{File|directory|'''pig_variant'''}} | ||
*****{{File|file|'''{{ph|name}}.json'''}} | |||
****{{File|directory|'''pig_sound_variant'''}} | |||
*****{{File|file|'''{{ph|name}}.json'''}} | *****{{File|file|'''{{ph|name}}.json'''}} | ||
****{{File|directory|'''wolf_variant'''}} | ****{{File|directory|'''wolf_variant'''}} | ||
| Line 40: | Line 49: | ||
** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ||
</div> | </div> | ||
=== Cat sounds === | |||
'''[[Minecraft:Cat]] sound variants''' are defined using the following format: | |||
<div class="treeview"> | |||
* {{nbt|compound}} The root object. | |||
** {{nbt|compound|adult_sounds}}: Sounds to use for adult cats. | |||
*** {{nbt|string}}{{nbt|compound|ambient_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|beg_for_food_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|death_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|eat_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|hiss_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|hurt_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|purr_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|purreow_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|stray_ambient_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
** {{nbt|compound|baby_sounds}}: Sounds to use for baby cats. | |||
*** Same fields as {{nbt|compound|adult_sounds}} | |||
</div> | |||
=== Chicken === | === Chicken === | ||
'''[[Minecraft:Chicken]] variants''' are defined using the following format: | '''[[Minecraft:Chicken]] variants''' are defined using the following format: | ||
| Line 49: | Line 86: | ||
** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ||
</div> | </div> | ||
=== Chicken sounds === | |||
'''[[Minecraft:Chicken]] sound variants''' are defined using the following format: | |||
<div class="treeview"> | |||
* {{nbt|compound}} The root object. | |||
** {{nbt|compound|adult_sounds}}: Sounds to use for adult chickens. | |||
*** {{nbt|string}}{{nbt|compound|ambient_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|death_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|hurt_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|step_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
** {{nbt|compound|baby_sounds}}: Sounds to use for baby chickens. | |||
*** Same fields as {{nbt|compound|adult_sounds}} | |||
</div> | |||
=== Cow === | === Cow === | ||
'''[[Minecraft:Cow]] variants''' are defined using the following format: | '''[[Minecraft:Cow]] variants''' are defined using the following format: | ||
| Line 58: | Line 113: | ||
** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ||
</div> | </div> | ||
=== Cow sounds === | |||
'''[[Minecraft:Cow]] sound variants''' are defined using the following format: | |||
<div class="treeview"> | |||
* {{nbt|compound}} The root object. | |||
** {{nbt|string}}{{nbt|compound|ambient_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
*** {{nbt inherit/sound event}} | |||
** {{nbt|string}}{{nbt|compound|death_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
*** {{nbt inherit/sound event}} | |||
** {{nbt|string}}{{nbt|compound|hurt_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
*** {{nbt inherit/sound event}} | |||
** {{nbt|string}}{{nbt|compound|step_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
*** {{nbt inherit/sound event}} | |||
</div> | |||
=== Frog === | === Frog === | ||
'''[[Minecraft:Frog]] variants''' are defined using the following format: | '''[[Minecraft:Frog]] variants''' are defined using the following format: | ||
| Line 65: | Line 135: | ||
** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ||
</div> | </div> | ||
=== Pig === | === Pig === | ||
'''[[Minecraft:Pig]] variants''' are defined using the following format: | '''[[Minecraft:Pig]] variants''' are defined using the following format: | ||
| Line 74: | Line 145: | ||
** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ||
</div> | </div> | ||
=== Pig sounds === | |||
'''[[Minecraft:Pig]] sound variants''' are defined using the following format: | |||
<div class="treeview"> | |||
* {{nbt|compound}} The root object. | |||
** {{nbt|compound|adult_sounds}}: Sounds to use for adult pigs. | |||
*** {{nbt|string}}{{nbt|compound|ambient_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|death_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|eat_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|hurt_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
*** {{nbt|string}}{{nbt|compound|step_sound}}: {{json_ref|server-side sound event|inline=1}} | |||
**** {{nbt inherit/sound event}} | |||
** {{nbt|compound|baby_sounds}}: Sounds to use for baby pigs. | |||
*** Same fields as {{nbt|compound|adult_sounds}} | |||
</div> | |||
=== Wolf === | === Wolf === | ||
'''[[Minecraft:Wolf]] variants''' are defined using the following format: | '''[[Minecraft:Wolf]] variants''' are defined using the following format: | ||
| Line 88: | Line 179: | ||
** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ** {{nbt|list|spawn_conditions}}: The spawn conditions of this variant, see {{slink||Spawn condition}} | ||
</div> | </div> | ||
=== Wolf sounds === | === Wolf sounds === | ||
'''[[Minecraft:Wolf]] sound variants''' are defined using the following format: | '''[[Minecraft:Wolf]] sound variants''' are defined using the following format: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound}} The root object. | * {{nbt|compound}} The root object. | ||
** {{nbt|compound|adult_sounds}}: Sounds to use for adult | ** {{nbt|compound|adult_sounds}}: Sounds to use for adult wolves. | ||
*** {{nbt|string}}{{nbt|compound|ambient_sound}}: {{json_ref|server-side sound event|inline=1}} | *** {{nbt|string}}{{nbt|compound|ambient_sound}}: {{json_ref|server-side sound event|inline=1}} | ||
**** {{nbt inherit/sound event}} | **** {{nbt inherit/sound event}} | ||
| Line 105: | Line 197: | ||
*** {{nbt|string}}{{nbt|compound|whine_sound}}: {{json_ref|server-side sound event|inline=1}} | *** {{nbt|string}}{{nbt|compound|whine_sound}}: {{json_ref|server-side sound event|inline=1}} | ||
**** {{nbt inherit/sound event}} | **** {{nbt inherit/sound event}} | ||
** {{nbt|compound|baby_sounds}}: Sounds to use for | ** {{nbt|compound|baby_sounds}}: Sounds to use for baby wolves. | ||
*** Same fields as {{nbt|compound|adult_sounds}} | *** Same fields as {{nbt|compound|adult_sounds}} | ||
</div> | </div> | ||
| Line 167: | Line 259: | ||
|{{HistoryLine||1.21.5|dev=25w03a|Added pig variants; including definitions in data packs.}} | |{{HistoryLine||1.21.5|dev=25w03a|Added pig variants; including definitions in data packs.}} | ||
|{{HistoryLine|||dev=25w04a | |{{HistoryLine|||dev=25w04a | ||
|Cat and | |Cat and frog variants can now be defined in data packs. | ||
|Added unified {{nbt|compound|spawn_conditions}} field, replacing {{nbt|string}}{{nbt|list|biomes}} field in wolf and pig variants. | |Added unified {{nbt|compound|spawn_conditions}} field, replacing {{nbt|string}}{{nbt|list|biomes}} field in wolf and pig variants. | ||
|Moved wolf variant {{nbt|string|angry_texture}}, {{nbt|string|wild_texture}}, and {{nbt|string|tame_texture}} field into {{nbt|compound|assets}} and removed {{cd|_texture}} suffix. | |Moved wolf variant {{nbt|string|angry_texture}}, {{nbt|string|wild_texture}}, and {{nbt|string|tame_texture}} field into {{nbt|compound|assets}} and removed {{cd|_texture}} suffix. | ||
| Line 174: | Line 266: | ||
|{{HistoryLine|||dev=25w05a|Added cow variants; including definitions in data packs.}} | |{{HistoryLine|||dev=25w05a|Added cow variants; including definitions in data packs.}} | ||
|{{HistoryLine|||dev=25w06a|Added chicken variants; including definitions in data packs.}} | |{{HistoryLine|||dev=25w06a|Added chicken variants; including definitions in data packs.}} | ||
|{{HistoryLine|||dev=25w08a|Added wolf sound variants; including definitions in data packs.}} | |||
|{{HistoryLine||1.21.11|dev=25w45a|Added zombie nautilus variants; including definitions in data packs.}} | |{{HistoryLine||1.21.11|dev=25w45a|Added zombie nautilus variants; including definitions in data packs.}} | ||
|{{HistoryLine||26.1|dev=snap2|Wolf sound variants sound events in {{cd|wolf_sound_variant}} has been moved into a new field {{cd|adult_sounds}} and the field {{cd|baby_sounds}} was added. | |{{HistoryLine||26.1|dev=snap2|Wolf sound variants sound events in {{cd|wolf_sound_variant}} has been moved into a new field {{cd|adult_sounds}} and the field {{cd|baby_sounds}} was added. | ||
|The textures for baby mobs can now be defined for cow, pig, chicken, wolf, and cat variants.}} | |The textures for baby mobs can now be defined for cow, pig, chicken, wolf, and cat variants.}} | ||
|{{HistoryLine|||dev=snap7|Added cat, pig, cow and chicken sounds variants; including definitions in data packs.}} | |||
}} | }} | ||
Latest revision as of 11:18, 22 July 2026
Mob variants are variants of Minecraft:mobs. They define the assets and models used and define the conditions in which this variant spawns.
Mob sound variants are sound variants distinct from regular variants. They define sounds used by this sound variant.
Definition
Mob variants can be defined in Minecraft:data packs, as part of the directory structure below.
JSON Format
Cat
Minecraft:Cat variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: The Minecraft:resource location of the texture to use.
- Template:Nbt: The Minecraft:resource location of the baby texture to use.
- Template:Nbt: The spawn conditions of this variant, see Template:Slink
Cat sounds
Minecraft:Cat sound variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: Sounds to use for adult cats.
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:Nbt: Sounds to use for baby cats.
- Same fields as Template:Nbt
- Template:Nbt: Sounds to use for adult cats.
Chicken
Minecraft:Chicken variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: The Minecraft:resource location of the texture to use.
- Template:Nbt: The Minecraft:resource location of the baby texture to use.
- Template:Nbt: The chicken model to use. Has to be Template:Cd or Template:Cd.
- Template:Nbt: The spawn conditions of this variant, see Template:Slink
Chicken sounds
Minecraft:Chicken sound variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: Sounds to use for adult chickens.
- Template:Nbt: Sounds to use for baby chickens.
- Same fields as Template:Nbt
Cow
Minecraft:Cow variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: The Minecraft:resource location of the texture to use.
- Template:Nbt: The Minecraft:resource location of the baby texture to use.
- Template:Nbt: The cow model to use. Has to be Template:Cd, Template:Cd or Template:Cd
- Template:Nbt: The spawn conditions of this variant, see Template:Slink
Cow sounds
Minecraft:Cow sound variants are defined using the following format:
Frog
Minecraft:Frog variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: The Minecraft:resource location of the texture to use.
- Template:Nbt: The spawn conditions of this variant, see Template:Slink
Pig
Minecraft:Pig variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: The Minecraft:resource location of the texture to use.
- Template:Nbt: The Minecraft:resource location of the baby texture to use.
- Template:Nbt: The pig model to use, has to be Template:Cd or Template:Cd. Defaults to Template:Cd
- Template:Nbt: The spawn conditions of this variant, see Template:Slink
Pig sounds
Minecraft:Pig sound variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: Sounds to use for adult pigs.
- Template:Nbt: Sounds to use for baby pigs.
- Same fields as Template:Nbt
Wolf
Minecraft:Wolf variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: The assets to use for this variant:
- Template:Nbt: The Minecraft:resource location of the texture to use when the wolf is angry.
- Template:Nbt: The Minecraft:resource location of the texture to use when the wolf is wild.
- Template:Nbt: The Minecraft:resource location of the texture to use when the wolf is tamed.
- Template:Nbt: The assets to use for the baby of this variant:
- Template:Nbt: The Minecraft:resource location of the texture to use when the wolf is angry.
- Template:Nbt: The Minecraft:resource location of the texture to use when the wolf is wild.
- Template:Nbt: The Minecraft:resource location of the texture to use when the wolf is tamed.
- Template:Nbt: The spawn conditions of this variant, see Template:Slink
- Template:Nbt: The assets to use for this variant:
Wolf sounds
Minecraft:Wolf sound variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: Sounds to use for adult wolves.
- Template:Nbt: Sounds to use for baby wolves.
- Same fields as Template:Nbt
Zombie Nautilus
Minecraft:Zombie nautilus variants are defined using the following format:
- Template:Nbt The root object.
- Template:Nbt: The Minecraft:resource location of the texture to use.
- Template:Nbt: The nautilus model to use, has to be Template:Cd or Template:Cd. Defaults to Template:Cd
- Template:Nbt: The spawn conditions of this variant, see Template:Slink
Spawn condition
Spawn conditions are used to determine which variant to spawn. Each variant contains a list of conditions with attached priorities. The selection of a variant happens in 3 steps:
- Each condition is evaluated. The matching condition with the highest priority determines the priority of the variant. If no condition matches the variant is discarded.
- Of all remaining variants, all except those with the highest priority are discarded.
- Of the remaining variants, a random variant is chosen.
Spawn conditions are specified using the following format:
- Template:Nbt: List of spawn conditions with priority
- Template:Nbt: A single spawn condition
- Template:Nbt: The priority of the variant if this spawn condition matches
- Template:Nbt: Condition to match. Always matches if omitted
- Template:Nbt: The type of the condition, see below for valid options
- Additional fields based on Template:Nbt, see below
- Template:Nbt: A single spawn condition
biome
Tests if the spawn position is inside one of the specified Minecraft:biomes.
- Template:Nbt
- Template:Nbt: Template:Cd
- Template:NbtTemplate:Nbt: Template:Json ref/biome — The biomes to match
structure
Tests if the spawn position is inside at least one of the specified Minecraft:structures.
- Template:Nbt
- Template:Nbt: Template:Cd
- Template:NbtTemplate:Nbt: Template:Json ref/structure — The structures to match
moon_brightness
Matches the Minecraft:moon brightness at the time of the spawn.
- Template:Nbt
- Template:Nbt: Template:Cd
- Template:NbtTemplate:Nbt: The moon brightness values to match — If specified as Template:Nbt: matches a single moon brightness value
- Template:Nbt: The minimum moon brightness to match
- Template:Nbt: The maximum moon brightness to match
History
Template:Navbox Java Edition technical
Minecraft:de:Kreaturvariantendefinition Minecraft:fr:Définition de variante de créature Minecraft:ja:エンティティの亜種のカスタマイズ Minecraft:pt:Definição de variantes de criatura