Mob variant definitions
Mob variants are variants of mobs. They define the assets and models used and define the conditions in which this variant spawns.
Definition
Mob variants can be defined in data packs, as part of the directory structure below.
data pack name.zip or
data pack name
pack.mcmeta
data
namespace
cat_variant
<name>.json
chicken_variant
<name>.json
cow_variant
<name>.json
frog_variant
<name>.json
pig_variant
<name>.json
wolf_variant
<name>.json
- More directories…
JSON Format
Cat
Cat variants are defined using the following format:
- [NBT Compound / JSON Object] The root object.
- [String] asset_id: The resource location of the texture to use.
- [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see § Spawn condition
Chicken
Chicken variants are defined using the following format:
- [NBT Compound / JSON Object] The root object.
- [String] asset_id: The resource location of the texture to use.
- [String] model: The chicken model to use. Has to be
normalorcold. - [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see § Spawn condition
Cow
Cow variants are defined using the following format:
- [NBT Compound / JSON Object] The root object.
- [String] asset_id: The resource location of the texture to use.
- [String] model: The cow model to use. Has to be
normal,coldorwarm - [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see § Spawn condition
Frog
Frog variants are defined using the following format:
- [NBT Compound / JSON Object] The root object.
- [String] asset_id: The resource location of the texture to use.
- [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see § Spawn condition
Pig
Pig variants are defined using the following format:
- [NBT Compound / JSON Object] The root object.
- [String] asset_id: The resource location of the texture to use.
- [String] model: The pig model to use, has to be
normalorcold. Defaults tonormal - [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see § Spawn condition
Wolf
Wolf variants are defined using the following format:
- [NBT Compound / JSON Object] The root object.
- [NBT Compound / JSON Object] assets: The assets to use for this variant:
- [String] angry: The resource location of the texture to use when the wolf is angry.
- [String] wild: The resource location of the texture to use when the wolf is wild.
- [String] tame: The resource location of the texture to use when the wolf is tamed.
- [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see § Spawn condition
- [NBT Compound / JSON Object] assets: The assets to use for this variant:
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:
- [NBT List / JSON Array] spawn_conditions: List of spawn conditions with priority
- [NBT Compound / JSON Object]: A single spawn condition
- [Int] priority: The priority of the variant if this spawn condition matches
- [NBT Compound / JSON Object] condition: Condition to match. Always matches if omitted
- [String] type: The type of the condition, see below for valid options
- Additional fields based on [String] type, see below
- [NBT Compound / JSON Object]: A single spawn condition
biome
Tests if the spawn position is inside one of the specified biomes.
structure
Tests if the spawn position is inside at least one of the specified structures.
moon_brightness
Matches the moon brightness at the time of the spawn.
- [NBT Compound / JSON Object] condition
- [String] type:
moon_brightness - [Double][NBT Compound / JSON Object] range: The moon brightness values to match — If specified as [Double]: matches a single moon brightness value
- [Double] min: The minimum moon brightness to match
- [Double] max: The maximum moon brightness to match
- [String] type:
History
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.20.5 | 24w10a | Added wolf variants; including definitions in data packs | |||||
| 1.21.5 | 25w03a | Added pig variants; including definitions in data packs | |||||
| 25w04a | Cat and Frog variants can now be defined in data packs | ||||||
| Added unified [NBT Compound / JSON Object] spawn_conditions field, replacing [String][NBT List / JSON Array] biomes field in wolf and pig variants. | |||||||
Moved wolf variant [String] angry_texture, [String] wild_texture, and [String] tame_texture field into [NBT Compound / JSON Object] assets and removed _texture suffix
| |||||||
| Renamed pig variant [String] texture field to [String] asset_id | |||||||
| 25w05a | Added cow variants; including definitions in data packs | ||||||
| 25w06a | Added chicken variants; including definitions in data packs | ||||||
| |||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||