Horde Scripts ‐ Spawn Event Functions - SmileycorpMC/The-Hordes GitHub Wiki
Functions describe an operation that the mod will perform when trying to start a horde, or spawn horde waves.
Spawn Event functions are applied when an entity is spawned in a horde. They are not compatible with spawnevent functions, and need to be in seperate files from those functions.
Example
{
"function": "hordes:set_entity_type",
"value": "minecraft:phantom",
"conditions": [{
"name": "hordes:comparison",
"value": {
"type": "int",
"operation": ">=",
"value1": {
"name": "hordes:player_pos",
"value": "y"
},
"value2": 100
}
}]
}
hordes:set_entity_type
changes the type of entity spawned in a horde event from one to another.
In the given example horde entities will be changed into a phantom if the player's y level is above 100 blocks.
Example
{
"function": "hordes:set_entity_nbt",
"value": "{HandItems:[{id:stone_sword,Count:1}]}",
"conditions": []
}
hordes:set_entity_nbt
modifies the nbt of entities before they spawn.
The above example gives a stone sword to entities spawned.
Example
{
"function": "hordes:set_entity_y",
"value": {
"name": "hordes:player_pos",
"value": "y"
},
"conditions": []
}}]
}
hordes:set_entity_x
, hordes:set_entity_y
and hordes:set_entity_z
all work identically, setting the spawn ccordinates of spawned entities.
The above example sets the entities spawn position to the players y value.
Example
{
"function": "set_entity_loot_table",
"value": "minecraft:chests/stronghold_library",
"conditions": []
}
hordes:set_entity_loot_table
sets the loot table of spawned entities.
The above example makes entities drop stronghold library loot.