VOOZH about

URL: https://minecraft.wiki/w/Pig_variant_definition

⇱ Mob variant definitions – Minecraft Wiki


Mob variant definitions

From Minecraft Wiki
(Redirected from Pig variant definition)
Jump to navigation Jump to search
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

[edit | edit source]

Mob variants can be defined in data packs, as part of the directory structure below.

JSON Format

[edit | edit source]

Cat variants are defined using the following format:

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

Chicken

[edit | edit source]

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] baby_asset_id: The resource location of the baby 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 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] baby_asset_id: The resource location of the baby 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 variants are defined using the following format:

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

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] baby_asset_id: The resource location of the baby 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 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 Compound / JSON Object] baby_assets: The assets to use for the baby of this variant:
    • [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see Β§ Spawn condition

Wolf sounds

[edit | edit source]

Wolf sound variants are defined using the following format:

Zombie Nautilus

[edit | edit source]

Zombie nautilus 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 nautilus model to use, has to be normal or warm. Defaults to normal
    • [NBT List / JSON Array] spawn_conditions: The spawn conditions of this variant, see Β§ Spawn condition

Spawn condition

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]
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.
1.21.1125w45aAdded zombie nautilus variants; including definitions in data packs.
26.1snap2Wolf sound variants sound events in wolf_sound_variant has been moved into a new field adult_sounds and the field baby_sounds was added.
The textures for baby mobs can now be defined for cow, pig, chicken, wolf, and cat variants.

Navigation

[edit | edit source]
Retrieved from "https://minecraft.wiki/w/Mob_variant_definitions?oldid=3494672#Pig"

Navigation menu