Horde Scripts ‐ Spawndata 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.
Spawndata functions are applied when a horde event starts and last for the whole event. They are not compatible with spawnevent functions, and need to be in seperate files from those functions.
Example
{
"function": "hordes:set_spawntable",
"value": [
"hordes:skeletons",
"hordes:illagers",
"hordes:mixed_mobs"
],
"conditions": []
}
hordes:set_spawntable
sets the table of mobs to use for spawning a horde event.
In the given example, there are several table, this means any time the mod starts an event and runs through this script, it will pick one of the listed tables, at random, with an equal chance for each.
If not set the mod will use hordes:fallback
as default.
Example 1
{
"function": "hordes:set_spawn_type",
"value": "prefer_water",
"conditions": []
}
Example 2
{
"function": "hordes:set_spawn_type",
"value": [
"minecraft:sand"
],
"conditions": []
}
Example 3
{
"function": "hordes:set_spawn_type",
"value": [
"minecraft:grass",
"#minecraft:dirt"
],
"conditions": []
}
hordes:set_spawn_type
sets which blocks horde mobs can spawn on. They won't always spawn on the allowed blocks, but the mod will try and prefer spawning on those blocks where possible.
There are two different types of spawn types, presets and custom.
If not set the mod will use avoid_fluids
as default.
Presets are formatted as in the first example and can be any of the following:
avoid_fluids
entities will attempt to spawn mobs on blocks which are not fluids or fluidlogged, this is the default setting.
prefer_water
entities will attempt to spawn mobs in water or on waterlogged blocks.
prefer_lava
entities will attempt to spawn mobs in lava or on lavalogged blocks (if any mods use fluidstates to add them).
ignore_water
entities will attempt to spawn mobs on non fluidlogged blocks, waterlogged blocks or in water, but not in other fluids.
ignore_fluids
entities will bypass any spawn checking and attempt to spawn anywhere there is space.
Custom spawn types are formatted as in example 2 and 3, they must be formatted as lists and can contain the registry name of any blocks, or any block tags entities should be able to spawn on.
Example
{
"function": "hordes:set_spawn_sound",
"value": "event.raid.horn",
"conditions": []
}
hordes:set_spawn_sound
sets the sound that plays each time a horde wave is spawned.
In the example above, it sets the spawn sound to the horn sound used in village raids.
If not set the mod will use hordes:horde_spawn
as default.
Example 1
{
"function": "hordes:set_start_message",
"value": "Raiders are coming to attack!",
"conditions": []
}
Example 2
{
"function": "hordes:set_end_message",
"value": "message.hordes.illager.end",
"conditions": []
}
hordes:set_start_message
sets the text that is sent to players when a horde event starts, correspondingly hordes:set_end_message
sets the text sent when a horde event ends.
Their value can either be text, or a translation key that corresponds to a value in a resource pack lang file.
If not set the mod will use the lang file translation message.hordes.EventStart
for start and message.hordes.EventEnd
for end as default.
Example
{
"function": "hordes:set_spawn_duration",
"value": 8000,
"conditions": []
}
hordes:set_spawn_duration
sets the length of a horde event in ticks.
In the example above, it sets the length to 8000 ticks (400 seconds) or 1/3 of a minecraft day.
If not set the mod will use the value set in hordes-common.toml.
Example
{
"function": "hordes:set_spawn_interval",
"value": 400,
"conditions": []
}
hordes:set_spawn_interval
sets how often waves spawn during a horde event.
In the example above, it sets the length to 400 ticks between spawns (20 seconds).
If not set the mod will use the value set in hordes-common.toml.
Example
{
"function": "hordes:set_spawn_amount",
"value": 20,
"conditions": []
}
hordes:set_spawn_amount
sets how many mobs spawn per wave. This bypasses the hordeSpawnMultiplier
value in the config, but not the scaling down effect in multiplayer from hordeMultiplayerScaling
.
If not set the mod will use the value set in hordes-common.toml.
Example
{
"function": "hordes:set_entity_speed",
"value": 1.5,
"conditions": []
}
hordes:set_entity_speed
sets how quickly horde mobs move towards their tracked player.
If not set the mod will use the value 1.