Skip to content

Commit

Permalink
- Spawn rules (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xterionix authored Mar 29, 2024
1 parent 26f6849 commit 95be084
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 70 deletions.
11 changes: 7 additions & 4 deletions source/behavior/spawn_rules/components/delay_filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@
"description": "This component allows players to set mobs spawn with certain time delays before they will spawn.",
"required": ["identifier"],
"properties": {
"min": { "type": "integer", "description": "This is the minimum delay that a mob spawns.", "title": "Min" },
"max": { "type": "integer", "description": "This is the maximum delay that a mob spawns.", "title": "Max" },
"min": { "type": "integer", "description": "This is the minimum delay that a mob spawns.", "title": "Min", "default": 0 },
"max": { "type": "integer", "description": "This is the maximum delay that a mob spawns.", "title": "Max", "default": 0 },
"identifier": {
"type": "string",
"description": "The identifier of the mob that will spawn.",
"title": "Identifier"
"title": "Identifier",
"$ref": "../../../general/entity/identifier.json"
},
"spawn_chance": {
"title": "Spawn Chance",
"description": "The percent chance that this entity will spawn.",
"type": "number",
"default": 100
"default": 100,
"minimum": 0,
"maximum": 100
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"additionalProperties": false,
"type": "object",
"title": "Disallow Spawns In Bubble",
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED"
}
"description": "Allows creators to keep entities from spawning in bubbles."
}
5 changes: 3 additions & 2 deletions source/behavior/spawn_rules/components/distance_filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"min": {
"type": "integer",
"description": "This is the minimum distance level that a mob spawns.",
"title": "Min"
"title": "Min",
"minimum": 24
},
"max": { "type": "integer", "description": "This is the maximum distance level that a mob spawns.", "title": "Max" }
"max": { "type": "integer", "description": "This is the maximum distance level that a mob spawns.", "title": "Max", "default": 128 }
}
}
44 changes: 0 additions & 44 deletions source/behavior/spawn_rules/components/entity_types.json

This file was deleted.

13 changes: 8 additions & 5 deletions source/behavior/spawn_rules/components/herd.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
"properties": {
"initial_event": {
"title": "Initial Event",
"description": "UNDOCUMENTED.",
"description": "Runs an event on the first entities in a group.",
"$comment": "UNDOCUMENTED",
"type": "string"
},
"initial_event_count": {
"title": "Initial Event Count",
"description": "UNDOCUMENTED.",
"description": "The number of entities that \"initial_event\" should trigger on.",
"$comment": "UNDOCUMENTED",
"type": "integer"
"type": "integer",
"default": 0
},
"min_size": {
"type": "integer",
Expand All @@ -29,7 +30,8 @@
"max_size": {
"type": "integer",
"description": "This is the maximum number of mobs that spawn in a herd.",
"title": "Maximum Size"
"title": "Maximum Size",
"maximum": 8
},
"event": {
"type": "string",
Expand All @@ -39,7 +41,8 @@
"event_skip_count": {
"type": "integer",
"description": "This is the number of mobs spawned before the specified event is triggered.",
"title": "Event Skip Count"
"title": "Event Skip Count",
"default": 0
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"title": "Player In Village Filter",
"description": "This component lets players be filtered by whether they are in a village or not, using distance and the village border definitions.",
"properties": {
"distance": { "type": "integer", "title": "Distance", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"distance": { "type": "integer", "title": "Distance", "description": "This is the maximum mob_event level that an entity spawns." },
"village_border_tolerance": {
"type": "integer",
"title": "Village Border Tolerance",
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED"
"description": "This is the minimum mob_event level that an entity spawns."
}
}
}
3 changes: 1 addition & 2 deletions source/behavior/spawn_rules/components/spawn_event.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"$id": "blockception.minecraft.behavior.spawn_rules.minecraft.spawn_event",
"title": "Spawn Event",
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED",
"description": "Event related to the spawning of an entity.",
"type": "object",
"additionalProperties": false,
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"title": "Spawns On Block Filter",
"description": "This component allows an entity to spawn on a particular block. It includes a string or array of strings for the block they may spawn on.",
"oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
}
}
3 changes: 2 additions & 1 deletion source/behavior/spawn_rules/components/weight.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"default": {
"type": "integer",
"description": "This is the priority of the mob spawning out of 100.",
"title": "Default"
"title": "Default",
"maximum": 100
},
"rarity": {
"type": "integer",
Expand Down
3 changes: 2 additions & 1 deletion source/behavior/spawn_rules/components/world_age_filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"title": "World Age Filter",
"description": "This component allows players to set mobs spawn after a certain amount of time has passed within a world.",
"additionalProperties": false,
"type": "object",
"properties": {
"min": {
"type": "integer",
"description": "This is the minimum world_age_filter level that a mob spawns.",
"description": "This is the minimum world_age_filter level that a mob spawns measured in seconds.",
"title": "Min"
}
}
Expand Down
11 changes: 7 additions & 4 deletions source/behavior/spawn_rules/spawn_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"$id": "blockception.behavior.spawn_rules",
"examples": [
{
"format_version": "1.20.41",
"format_version": "1.8.0",
"minecraft:spawn_rules": { "description": { "identifier": "minecraft:entity", "population_control": "ambient" }, "conditions": [{}] }
}
],
Expand All @@ -13,7 +13,11 @@
"additionalProperties": false,
"required": ["format_version", "minecraft:spawn_rules"],
"properties": {
"format_version": { "$ref": "../../general/format_version.json" },
"format_version": {
"title": "Format Version",
"description": "A version that tells minecraft what type of data format can be expected when reading this file.",
"enum": ["1.8.0", "1.10.0", "1.12.0"]
},
"minecraft:spawn_rules": {
"type": "object",
"title": "Spawn Rules",
Expand All @@ -39,7 +43,7 @@
"title": "Population Control",
"description": "Setting an entity to a pool it will spawn as long as that pool hasn't reached the spawn limit.",
"$comment": "UNDOCUMENTED",
"enum": ["ambient", "animal", "water_animal", "monster", "cat"]
"enum": ["ambient", "animal", "water_animal", "monster", "cat", "pillager"]
}
}
},
Expand All @@ -63,7 +67,6 @@
"minecraft:disallow_spawns_in_bubble": { "$ref": "./components/disallow_spawns_in_bubble.json" },
"minecraft:distance_filter": { "$ref": "./components/distance_filter.json" },
"minecraft:height_filter": { "$ref": "./components/height_filter.json" },
"minecraft:entity_types": { "$ref": "./components/entity_types.json" },
"minecraft:herd": { "$ref": "./components/herd.json" },
"minecraft:mob_event_filter": { "$ref": "./components/mob_event_filter.json" },
"minecraft:permute_type": { "$ref": "./components/permute_type.json" },
Expand Down

0 comments on commit 95be084

Please sign in to comment.