-
Notifications
You must be signed in to change notification settings - Fork 1
[Version 4.10] Time Existed Modifier
Insane96 edited this page May 25, 2024
·
2 revisions
Time Existed Modifier (Inherits from Modifier)
-
bonus_per_seconds
: (Modifiable Value Object) bonus applied each timeseconds
have passed -
seconds
: (Modifiable Value Object) Every how many seconds will the value increase bybonus_per_seconds
-
max_bonus_percentage
: (Modifiable Value Object) The maximum valuebonus_per_seconds
can reach -
mode
: (String) How thebonus_per_seconds
is calculated when there are multiple players near (up to 128 blocks) the mob spawned. If omitted, defaults to "average"- "average": Makes an average of time played of the nearby players
- "sum": Sums the time played of the nearby players
- "nearest": Takes into account only the time played of the nearest player
- If
operation
is set to "add", the finalbonus_per_seconds
is added to the modified value, else ifoperation
is set to "multiply",bonus_per_seconds
is threated as a bonus percentage. Check examples.
In this example the chance for the creeper to get speed on spawn increases by a flat 5% every hour.
So after 2 hours of play the chance will be 0.15 + (0.05 * 2) = 0.15 + 0.10 = 0.25 = 25%
{
"target": "minecraft:creeper",
"potion_effects": [
{
"id": "minecraft:speed",
"chance": {
"value": 0.15,
"time_existed_modifier": {
"operation": "add",
"bonus_per_seconds": 0.05,
"seconds": 3600
}
}
}
]
}
In this example instead, the chance increases by 25% every hour (doubles every 4 hours).
So after 2 hours of play the chance will be 0.15 * (0.25 * 2 + 1) = 0.15 * 1.50 = 0.30 = 30%
{
"target": "minecraft:creeper",
"potion_effects": [
{
"id": "minecraft:speed",
"chance": {
"value": 0.15,
"time_existed_modifier": {
"operation": "multiply",
"bonus_per_seconds": 0.25,
"seconds": 3600
}
}
}
]
}