Freeze (Entity Action Type)
Sets the entity's freeze counter, the same counter powder snow fills. It drives the frost vignette, the blue tint on the model and, once it is full, freeze damage.
Type ID: apoli:freeze
Fields
| Field | Type | Default | Description |
|---|---|---|---|
duration | Integer or Expression | optional | What to set the freeze counter to. Left out, the entity is frozen solid immediately and stays there: the counter is set just far enough past the threshold to survive vanilla's drain, so freeze damage lands. A negative value freezes it for good. |
How the counter behaves
duration is the value the counter is set to, and vanilla counts it down by itself afterwards, so there is nothing to clean up.
| Property | Value |
|---|---|
| Fully frozen at | 140 on almost everything (getTicksRequiredToFreeze) |
| Drains by | 2 per tick on a living entity that is out of powder snow, down to 0 |
| Drains by | nothing on an entity that isn't alive, which keeps whatever you set until something clears it |
| Damage | 1 every 40 ticks while the counter is full, on living entities the server ticks |
So "duration": 140 gives a player 70 ticks of visible frost, and none of it counts as fully frozen. The drain runs before the damage check each tick, so a counter set exactly to the threshold is already below it when vanilla looks. Leave duration out, or set it at least 2 above the threshold, if you want the damage. For a lasting freeze, run the action repeatedly: apoli:action_over_time with "interval": 1 fills the counter faster than vanilla drains it.
Entities in #minecraft:freeze_immune_entity_types (strays, polar bears, snow golems and the wither) never take freeze damage, though the counter still rises and the frost still shows. Setting an entity on fire clears the counter outright.
Examples
Freeze solid on the spot:
{
"type": "apoli:freeze"
}Half a second of frost on a player, and nothing after:
{
"type": "apoli:freeze",
"duration": 20
}Keep the entity frozen for as long as the power's condition holds, here while it is in a snowy biome. This is the shape an apoli:freeze power is read as:
{
"type": "apoli:action_over_time",
"interval": 1,
"entity_action": {
"type": "apoli:freeze"
},
"condition": {
"type": "apoli:biome",
"condition": {
"type": "apoli:precipitation",
"precipitation": "snow"
}
}
}Frost that deepens as a resource drains:
{
"type": "apoli:freeze",
"duration": "280 - example:warmth * 2"
}{"type": "apoli:freeze"} written as a power is read as the apoli:action_over_time above. Write the action in new packs, since it can be fired from anything and takes a duration.