-
Notifications
You must be signed in to change notification settings - Fork 1
[Version 4.10] World Spawn Distance Modifier
World Spawn Distance Modifier (Inherits from Modifier)
-
amount_per_step
: (Modifiable Value Object) Eachstep
blocks from spawn will increase the value to modify by this value. -
step
: (Modifiable Value Object) -
shift
: (Modifiable Value Object) Shifts the distance from spawn by this value -
distance_cap
: (Modifiable Value Object) Distance in calculations will be capped to this value
If operation
is "multiply" the result is treated as a percentage increase, the formula is
value * (1 + ((distance + shift) / step) * amount_per_step)
Else if operation
is "add" the result is added to the value, the formula is
value + (((distance + shift) / step) * amount_per_step)
With this example, Creepers have 10% chance to spawn with Speed I, increased by 2% flat every 100 blocks from world spawn. So if a creeper spawns 150 blocks from spawn, the chance for Speed I to apply will be 0.10 + ((150 / 100) * 0.02) = 0.10 + 0.03 = 13%
{
"target": "minecraft:creeper",
"potion_effects": [
{
"id": "minecraft:speed",
"chance": {
"value": 0.10,
"world_spawn_distance_modifier": {
"operation": "add",
"amount_per_step": 0.02,
"step": 100
}
}
}
]
}
Here instead, the amount of bonus health the creeper gets is 10 plus 20% more every 100 blocks from spawn. So if a creeper spawns 150 blocks from spawn, the bonus health applied will be 10 * (1 + (150 / 100) * 0.20) = 0.10 * 1.3 = 13
{
"target": "minecraft:creeper",
"attributes": [
{
"id": "minecraft:generic.max_health",
"modifier_name": "More Health for Spiders",
"amount": {
"value": {
"value": 0.15,
"world_spawn_distance_modifier": {
"operation": "add",
"amount_per_step": 0.20,
"step": 100
}
}
},
"operation": "multiply_base"
}
]
}