Mob variant definitions

This feature is exclusive to Java Edition.
 

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.

  • File archive.png: Sprite image for archive in Minecraft data pack name.zip or File directory.png: Sprite image for directory in Minecraft data pack name
    • File file.png: Sprite image for file in Minecraft pack.mcmeta
    • File directory.png: Sprite image for directory in Minecraft data
      • File directory.png: Sprite image for directory in Minecraft namespace
        • File directory.png: Sprite image for directory in Minecraft cat_variant
          • File file.png: Sprite image for file in Minecraft <name>.json
        • File directory.png: Sprite image for directory in Minecraft chicken_variant
          • File file.png: Sprite image for file in Minecraft <name>.json
        • File directory.png: Sprite image for directory in Minecraft cow_variant
          • File file.png: Sprite image for file in Minecraft <name>.json
        • File directory.png: Sprite image for directory in Minecraft frog_variant
          • File file.png: Sprite image for file in Minecraft <name>.json
        • File directory.png: Sprite image for directory in Minecraft pig_variant
          • File file.png: Sprite image for file in Minecraft <name>.json
        • File directory.png: Sprite image for directory in Minecraft wolf_variant
          • File file.png: Sprite image for file in Minecraft <name>.json
        • More directories…

JSON Format

Cat

Cat variants are defined using the following format:

  • [NBT Compound / JSON Object] The root object.

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 normal or cold.
    • [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, cold or warm
    • [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.

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 normal or cold. Defaults to normal
    • [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:
    • [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see § Spawn condition

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:

  1. 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.
  2. Of all remaining variants, all except those with the highest priority are discarded.
  3. 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

biome

Tests if the spawn position is inside one of the specified biomes.

  • [NBT Compound / JSON Object] condition
    • [String] type: biome
    • [String][NBT List / JSON Array] biomes: Any number of biome(s) (an [String] ID, or a [String] tag with #, or an [NBT List / JSON Array] array containing [String] IDs) — The biomes to match

structure

Tests if the spawn position is inside at least one of the specified structures.

  • [NBT Compound / JSON Object] condition
    • [String] type: structure
    • [String][NBT List / JSON Array] structures: Any number of structure(s) (an [String] ID, or a [String] tag with #, or an [NBT List / JSON Array] array containing [String] IDs) — The structures to match

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

History

Java Edition
1.20.524w10aAdded wolf variants; including definitions in data packs
1.21.525w03aAdded pig variants; including definitions in data packs
25w04aCat 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
25w05aAdded cow variants; including definitions in data packs
25w06aAdded chicken variants; including definitions in data packs

Navigation