@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
860 lines (859 loc) • 34.5 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "/spawn/spawn_rules.form.json",
"title": "Spawn Rules",
"description": "Defines the complete spawn rules for an entity type, including population control group, spawn conditions (biome, light, difficulty, etc.), and herd configuration. This is the root structure of a spawn_rules JSON file in behavior packs.",
"type": "object",
"properties": {
"conditions": {
"title": "Conditions",
"description": "Spawn condition sets that define when and how this entity spawns. Each condition combines filters for biome, brightness, height, difficulty, and more.",
"type": "array",
"items": {
"$ref": "#/$defs/spawn_spawn_biomeconditions"
}
},
"description": {
"title": "Description",
"description": "Identifies which entity these spawn rules apply to and which population control group manages its spawn cap.",
"$ref": "#/$defs/spawn_spawn_description",
"defaultSnippets": [
{
"label": "Spawn Description",
"description": "The description block that identifies which entity these spawn rules apply to, via the entity identifier (e.g., 'minecraft:zombie'). Also specifies the population control group for managing spawn caps.",
"body": {
"identifier": "",
"population_control": ""
}
}
]
}
},
"required": [
"description"
],
"$defs": {
"spawn_spawn_brightnessfilter": {
"type": "object",
"title": "Spawn BrightnessFilter",
"description": "Restricts mob spawning based on light level at the spawn location. Hostile mobs typically spawn in darkness (light level 0-7), while passive mobs spawn in brighter areas. Allows setting min/max brightness thresholds and whether to adjust for spawning on a block surface.",
"properties": {
"adjust_for_weather": {
"title": "Adjust For Weather",
"type": "boolean",
"default": false
},
"max": {
"title": "Max",
"type": "integer",
"maximum": 15,
"default": 15
},
"min": {
"title": "Min",
"type": "integer",
"maximum": 15,
"default": 0
}
}
},
"spawn_spawn_delayfilter": {
"type": "object",
"title": "Spawn DelayFilter",
"description": "Delays entity spawning by a configurable amount of time after spawn conditions are met. Useful for preventing immediate respawning after mob deaths or creating spawn cooldowns for rare creatures.",
"properties": {
"identifier": {
"title": "Identifier",
"type": "string",
"default": ""
},
"max": {
"title": "Max",
"type": "integer",
"default": 0
},
"min": {
"title": "Min",
"type": "integer",
"default": 0
},
"spawn_chance": {
"title": "Spawn Chance",
"type": "integer",
"default": 100
}
}
},
"spawn_spawn_densitylimit": {
"type": "object",
"title": "Spawn DensityLimit",
"description": "Limits how many of this entity type can exist in an area, with separate caps for surface and underground spawning. This prevents overpopulation and controls mob density for performance and gameplay balance.",
"properties": {
"surface": {
"title": "Surface",
"type": "integer",
"minimum": -1,
"default": -1
},
"underground": {
"title": "Underground",
"type": "integer",
"minimum": -1,
"default": -1
}
}
},
"spawn_spawn_difficultyfilter": {
"type": "object",
"title": "Spawn DifficultyFilter",
"description": "Restricts mob spawning to specific difficulty levels (Peaceful, Easy, Normal, Hard). For example, hostile mobs don't spawn on Peaceful, and some dangerous variants only appear on Hard difficulty.",
"properties": {
"max": {
"title": "SpawnDifficulty Legacy",
"type": "string",
"enum": [
"easy",
"hard",
"normal",
"peaceful"
],
"default": "hard"
},
"min": {
"title": "SpawnDifficulty Legacy",
"type": "string",
"enum": [
"easy",
"hard",
"normal",
"peaceful"
],
"default": "peaceful"
}
}
},
"spawn_spawn_distancefilter": {
"type": "object",
"title": "Spawn DistanceFilter",
"description": "Controls spawning based on distance from the nearest player. Mobs typically spawn within a certain radius around players (24-128 blocks) and despawn when players move too far away.",
"properties": {
"max": {
"title": "Max",
"type": "integer",
"default": 128
},
"min": {
"title": "Min",
"type": "integer",
"default": 24
}
}
},
"spawn_spawn_heightfilter": {
"type": "object",
"title": "Spawn HeightFilter",
"description": "Restricts entity spawning to specific Y-coordinate ranges. Useful for creating depth-based mob distribution like slimes in swamps (below Y=40), or limiting surface mobs from spawning underground.",
"properties": {
"max": {
"title": "Max",
"type": "integer",
"default": 128
},
"min": {
"title": "Min",
"type": "integer",
"default": 24
}
}
},
"spawn_spawn_mobeventfilter": {
"type": "object",
"title": "Spawn MobEventFilter",
"description": "Controls spawning based on whether a specific mob event is active. Mob events are world-level toggles (like raids or wandering traders) that can enable or disable certain spawn behaviors.",
"properties": {
"event": {
"title": "Event",
"type": "string",
"default": ""
}
}
},
"spawn_spawn_playerinvillagefilter": {
"type": "object",
"title": "Spawn PlayerInVillageFilter",
"description": "Restricts spawning based on whether a player is within village boundaries. Used for village-specific spawns like iron golems, cats, and raid mobs that should only appear when players are near villages.",
"properties": {
"distance": {
"title": "Distance",
"type": "integer"
},
"village_border_tolerance": {
"title": "Village Border Tolerance",
"type": "integer",
"default": 10
}
},
"required": [
"distance"
]
},
"spawn_spawn_spawnaboveblockfilter": {
"type": "object",
"title": "Spawns Above Block Filter",
"description": "Filters spawning based on blocks above the spawn location. This component appears to have been deprecated or changed in versions after 1.17.20.",
"properties": {
"blocks": {
"title": "Blocks",
"type": "object"
},
"distance": {
"title": "Distance",
"type": "integer",
"default": 1
}
}
},
"spawn_spawn_weight": {
"type": "object",
"title": "Spawn Weight",
"description": "Defines the relative probability of this entity spawning compared to other entities in the same biome and spawn pool. Higher weight values mean more frequent spawns. A weight of 100 is typical for common mobs.",
"properties": {
"default": {
"title": "Default",
"type": "integer"
},
"rarity": {
"title": "Rarity",
"type": "integer",
"default": 0
}
},
"required": [
"default"
]
},
"spawn_spawn_worldagefilter": {
"type": "object",
"title": "Spawn WorldAgeFilter",
"description": "Restricts spawning based on how long the world has existed (measured in ticks). Useful for progressive difficulty where certain mobs only start appearing after the world has been played for a minimum amount of time.",
"properties": {
"max": {
"title": "Max",
"type": "integer",
"default": -1
},
"min": {
"title": "Min",
"type": "integer",
"default": 0
}
}
},
"spawn_spawn_biomeconditions": {
"type": "object",
"title": "Spawn Biome Conditions",
"description": "Defines the conditions under which an entity can spawn, including biome filters, brightness, height, and herd settings.",
"properties": {
"minecraft:spawns_lava": {
"title": "Spawns In Lava",
"description": "Indicates the entity can spawn in lava.",
"type": "object"
},
"minecraft:disallow_spawns_in_bubble": {
"title": "Disallow Spawns In Bubble",
"description": "Prevents spawning inside bubble columns.",
"type": "object"
},
"minecraft:biome_filter": {
"anyOf": [
{
"type": "object",
"properties": {
"domain": {
"title": "Domain",
"description": "The domain the test should be performed in.",
"type": "string"
},
"operator": {
"title": "Operator",
"description": "The comparison to apply with 'value'.",
"type": "string"
},
"subject": {
"title": "Subject",
"description": "The subject of this filter test.",
"type": "string"
},
"test": {
"title": "Test",
"description": "The name of the test to apply.",
"type": "string"
},
"value": {
"title": "Value",
"description": "The value being compared with the test.",
"type": "integer"
},
"all_of": {
"title": "All Of",
"description": "All of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"any_of": {
"title": "Any Of",
"description": "Any of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"none_of": {
"title": "None Of",
"description": "None of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
}
}
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"domain": {
"title": "Domain",
"description": "The domain the test should be performed in.",
"type": "string"
},
"operator": {
"title": "Operator",
"description": "The comparison to apply with 'value'.",
"type": "string"
},
"subject": {
"title": "Subject",
"description": "The subject of this filter test.",
"type": "string"
},
"test": {
"title": "Test",
"description": "The name of the test to apply.",
"type": "string"
},
"value": {
"title": "Value",
"description": "The value being compared with the test.",
"type": "integer"
},
"all_of": {
"title": "All Of",
"description": "All of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"any_of": {
"title": "Any Of",
"description": "Any of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"none_of": {
"title": "None Of",
"description": "None of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
}
}
}
},
{
"type": "object",
"properties": {
"all_of": {
"type": "array",
"items": {
"type": "object",
"properties": {
"domain": {
"title": "Domain",
"description": "The domain the test should be performed in.",
"type": "string"
},
"operator": {
"title": "Operator",
"description": "The comparison to apply with 'value'.",
"type": "string"
},
"subject": {
"title": "Subject",
"description": "The subject of this filter test.",
"type": "string"
},
"test": {
"title": "Test",
"description": "The name of the test to apply.",
"type": "string"
},
"value": {
"title": "Value",
"description": "The value being compared with the test.",
"type": "integer"
},
"all_of": {
"title": "All Of",
"description": "All of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"any_of": {
"title": "Any Of",
"description": "Any of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"none_of": {
"title": "None Of",
"description": "None of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
}
}
}
},
"any_of": {
"type": "array",
"items": {
"type": "object",
"properties": {
"domain": {
"title": "Domain",
"description": "The domain the test should be performed in.",
"type": "string"
},
"operator": {
"title": "Operator",
"description": "The comparison to apply with 'value'.",
"type": "string"
},
"subject": {
"title": "Subject",
"description": "The subject of this filter test.",
"type": "string"
},
"test": {
"title": "Test",
"description": "The name of the test to apply.",
"type": "string"
},
"value": {
"title": "Value",
"description": "The value being compared with the test.",
"type": "integer"
},
"all_of": {
"title": "All Of",
"description": "All of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"any_of": {
"title": "Any Of",
"description": "Any of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"none_of": {
"title": "None Of",
"description": "None of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
}
}
}
},
"none_of": {
"type": "array",
"items": {
"type": "object",
"properties": {
"domain": {
"title": "Domain",
"description": "The domain the test should be performed in.",
"type": "string"
},
"operator": {
"title": "Operator",
"description": "The comparison to apply with 'value'.",
"type": "string"
},
"subject": {
"title": "Subject",
"description": "The subject of this filter test.",
"type": "string"
},
"test": {
"title": "Test",
"description": "The name of the test to apply.",
"type": "string"
},
"value": {
"title": "Value",
"description": "The value being compared with the test.",
"type": "integer"
},
"all_of": {
"title": "All Of",
"description": "All of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"any_of": {
"title": "Any Of",
"description": "Any of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
},
"none_of": {
"title": "None Of",
"description": "None of these tests must pass.",
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
},
{
"description": "Array of filter objects.",
"type": "array",
"items": {
"type": "object"
}
}
],
"description": "Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects."
},
"minecraft:spawns_on_block_filter": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object"
}
},
{
"description": "A single block name string",
"type": "string"
},
{
"description": "An array of block name strings",
"type": "array",
"items": {
"type": "string"
}
}
],
"title": "Spawns On Block Filter",
"description": "Specifies blocks on which this entity can spawn. Can be a single block name string, an array of block objects with name property, or an array of strings representing block names."
},
"minecraft:spawns_on_block_prevented_filter": {
"title": "Spawns On Block Prevented Filter",
"description": "Specifies blocks on which this entity cannot spawn. Can be an array of block name strings.",
"type": "array",
"items": {
"type": "string"
}
},
"minecraft:herd": {
"anyOf": [
{
"type": "object"
},
{
"description": "Array of herd configurations.",
"type": "array",
"items": {
"type": "object"
}
}
],
"title": "Herd",
"description": "Specifies herd spawning configuration. Can be a single herd object or an array of herd objects."
},
"minecraft:permute_type": {
"anyOf": [
{
"type": "object"
},
{
"description": "Array of permutation configurations.",
"type": "array",
"items": {
"type": "object"
}
}
],
"title": "Permute Type",
"description": "Specifies permutation types for spawning. Can be a single object or an array of permutation objects."
},
"minecraft:brightness_filter": {
"title": "Brightness Filter",
"description": "Restricts spawning based on light level. Hostile mobs typically spawn in darkness (0-7), passive mobs in brighter areas.",
"$ref": "#/$defs/spawn_spawn_brightnessfilter",
"defaultSnippets": [
{
"label": "Spawn BrightnessFilter",
"description": "Restricts mob spawning based on light level at the spawn location. Hostile mobs typically spawn in darkness (light level 0-7), while passive mobs spawn in brighter areas. Allows setting min/max brightness thresholds and whether to adjust for spawning on a block surface.",
"body": {
"adjust_for_weather": false,
"max": 15,
"min": 0
}
}
]
},
"minecraft:delay_filter": {
"title": "Delay Filter",
"description": "Delays entity spawning by a configurable time after conditions are met. Useful for cooldowns after mob deaths.",
"$ref": "#/$defs/spawn_spawn_delayfilter",
"defaultSnippets": [
{
"label": "Spawn DelayFilter",
"description": "Delays entity spawning by a configurable amount of time after spawn conditions are met. Useful for preventing immediate respawning after mob deaths or creating spawn cooldowns for rare creatures.",
"body": {
"identifier": "",
"max": 0,
"min": 0,
"spawn_chance": 100
}
}
]
},
"minecraft:density_limit": {
"title": "Density Limit",
"description": "Limits how many of this entity can exist in an area. Set -1 for unlimited.",
"$ref": "#/$defs/spawn_spawn_densitylimit",
"defaultSnippets": [
{
"label": "Spawn DensityLimit",
"description": "Limits how many of this entity type can exist in an area, with separate caps for surface and underground spawning. This prevents overpopulation and controls mob density for performance and gameplay balance.",
"body": {
"surface": -1,
"underground": -1
}
}
]
},
"minecraft:difficulty_filter": {
"title": "Difficulty Filter",
"description": "Restricts spawning to specific difficulty levels. For example, hostile mobs don't spawn on Peaceful.",
"$ref": "#/$defs/spawn_spawn_difficultyfilter",
"defaultSnippets": [
{
"label": "Spawn DifficultyFilter",
"description": "Restricts mob spawning to specific difficulty levels (Peaceful, Easy, Normal, Hard). For example, hostile mobs don't spawn on Peaceful, and some dangerous variants only appear on Hard difficulty.",
"body": {
"max": "hard",
"min": "peaceful"
}
}
]
},
"minecraft:distance_filter": {
"title": "Distance Filter",
"description": "Controls spawning based on distance from the nearest player. Mobs typically spawn 24-128 blocks from players.",
"$ref": "#/$defs/spawn_spawn_distancefilter",
"defaultSnippets": [
{
"label": "Spawn DistanceFilter",
"description": "Controls spawning based on distance from the nearest player. Mobs typically spawn within a certain radius around players (24-128 blocks) and despawn when players move too far away.",
"body": {
"max": 128,
"min": 24
}
}
]
},
"minecraft:height_filter": {
"title": "Height Filter",
"description": "Restricts spawning to specific Y-coordinate ranges. Useful for depth-based mob distribution.",
"$ref": "#/$defs/spawn_spawn_heightfilter",
"defaultSnippets": [
{
"label": "Spawn HeightFilter",
"description": "Restricts entity spawning to specific Y-coordinate ranges. Useful for creating depth-based mob distribution like slimes in swamps (below Y=40), or limiting surface mobs from spawning underground.",
"body": {
"max": 128,
"min": 24
}
}
]
},
"minecraft:is_experimental": {
"title": "Is Experimental",
"description": "Marks this spawn rule as experimental. Only active when the corresponding experiment toggle is enabled.",
"type": "object"
},
"minecraft:is_persistent": {
"title": "Is Persistent",
"description": "When enabled, spawned entities will not despawn naturally. Used for mobs like villagers that should remain in the world.",
"type": "object"
},
"minecraft:mob_event_filter": {
"title": "Mob Event Filter",
"description": "Controls spawning based on whether a specific mob event (like raids or wandering traders) is active.",
"$ref": "#/$defs/spawn_spawn_mobeventfilter",
"defaultSnippets": [
{
"label": "Spawn MobEventFilter",
"description": "Controls spawning based on whether a specific mob event is active. Mob events are world-level toggles (like raids or wandering traders) that can enable or disable certain spawn behaviors.",
"body": {
"event": ""
}
}
]
},
"minecraft:player_in_village_filter": {
"title": "Player In Village Filter",
"description": "Restricts spawning to when a player is near a village. Used for iron golems, cats, and raid mobs.",
"$ref": "#/$defs/spawn_spawn_playerinvillagefilter",
"defaultSnippets": [
{
"label": "Spawn PlayerInVillageFilter",
"description": "Restricts spawning based on whether a player is within village boundaries. Used for village-specific spawns like iron golems, cats, and raid mobs that should only appear when players are near villages.",
"body": {
"distance": 0,
"village_border_tolerance": 10
}
}
]
},
"minecraft:spawn_event": {
"title": "Spawn Event",
"description": "Triggers a specific entity event when the mob spawns. Commonly used to initialize entity behavior.",
"$ref": "#/$defs/spawn_spawn_mobeventfilter",
"defaultSnippets": [
{
"label": "Spawn MobEventFilter",
"description": "Controls spawning based on whether a specific mob event is active. Mob events are world-level toggles (like raids or wandering traders) that can enable or disable certain spawn behaviors.",
"body": {
"event": ""
}
}
]
},
"minecraft:spawns_above_block_filter": {
"title": "Spawns Above Block Filter",
"description": "Filters spawning based on blocks above the spawn point. Deprecated in versions after 1.17.20.",
"$ref": "#/$defs/spawn_spawn_spawnaboveblockfilter",
"defaultSnippets": [
{
"label": "Spawns Above Block Filter",
"description": "Filters spawning based on blocks above the spawn location. This component appears to have been deprecated or changed in versions after 1.17.20.",
"body": {
"blocks": [],
"distance": 1
}
}
]
},
"minecraft:spawns_on_surface": {
"title": "Spawns On Surface",
"description": "When enabled, this entity can spawn on the world surface.",
"type": "object"
},
"minecraft:spawns_underground": {
"title": "Spawns Underground",
"description": "When enabled, this entity can spawn underground (below the surface).",
"type": "object"
},
"minecraft:spawns_underwater": {
"title": "Spawns Underwater",
"description": "When enabled, this entity can spawn in water.",
"type": "object"
},
"minecraft:weight": {
"title": "Weight",
"description": "Relative spawn probability compared to other entities in the same biome. Higher values = more frequent spawns. 100 is typical for common mobs.",
"$ref": "#/$defs/spawn_spawn_weight",
"defaultSnippets": [
{
"label": "Spawn Weight",
"description": "Defines the relative probability of this entity spawning compared to other entities in the same biome and spawn pool. Higher weight values mean more frequent spawns. A weight of 100 is typical for common mobs.",
"body": {
"default": 0,
"rarity": 0
}
}
]
},
"minecraft:world_age_filter": {
"title": "World Age Filter",
"description": "Restricts spawning based on world age (in ticks). Useful for progressive difficulty where certain mobs appear later.",
"$ref": "#/$defs/spawn_spawn_worldagefilter",
"defaultSnippets": [
{
"label": "Spawn WorldAgeFilter",
"description": "Restricts spawning based on how long the world has existed (measured in ticks). Useful for progressive difficulty where certain mobs only start appearing after the world has been played for a minimum amount of time.",
"body": {
"max": -1,
"min": 0
}
}
]
}
}
},
"spawn_spawn_description": {
"type": "object",
"title": "Spawn Description",
"description": "The description block that identifies which entity these spawn rules apply to, via the entity identifier (e.g., 'minecraft:zombie'). Also specifies the population control group for managing spawn caps.",
"properties": {
"identifier": {
"title": "Identifier",
"description": "The entity identifier these spawn rules apply to, e.g. 'minecraft:zombie' or 'mypack:custom_mob'.",
"type": "string"
},
"population_control": {
"title": "Population Control",
"description": "The population control group. Controls the spawn cap for this entity type. Common values: 'animal', 'monster', 'water_animal', 'ambient'.",
"type": "string",
"default": ""
}
},
"required": [
"identifier"
]
}
}
}