Status Effect Instance (Data Type)

An Object used to define a status effect with duration, amplifier, etc.

An Object used to define a status effect with duration, amplifier, etc.

NOTE: To make the Status Effect Instance infinite, you can set the value of duration to -1.

ALIASES (1.21.1): Apace renamed effectid and is_ambientambient to match vanilla. Both spellings are accepted, so data packs from either era load unchanged.

Fields

FieldTypeDefaultDescription
effectIdentifierThe identifier of the status effect. Alias: id.
durationInteger or Expression100Determines the duration of the status effect (in ticks). An Expression is evaluated against the entity the effect is applied to, at application time.
amplifierInteger or Expression0Determines the strength of the status effect (0 being level 1). Accepts an Expression like duration.
is_ambientBooleanfalseDetermines whether the particle effects of the status effect is less noticeable. Alias: ambient.
show_particlesBooleantrueDetermines whether the status effect should display particle effects on the entity.
show_iconBooleantrueDetermines whether the status effect would display an icon on the HUD.

Examples

"effect": {
    "effect": "minecraft:slowness",
    "amplifier": 1,
    "duration": -1
}

A Slowness II status with an infinite duration.

"effect": {
    "effect": "minecraft:levitation",
    "duration": 200,
    "is_ambient": true,
    "show_particles": true,
    "show_icon": false
}

An ambient and mostly hidden status effect of Levitation I which lasts for 10 seconds.

"effects": [
    {
        "effect": "minecraft:slow_falling",
        "duration": 400,
        "is_ambient": false,
        "show_particles": false,
        "show_icon": true
    },
    {
        "effect": "minecraft:slowness",
        "duration": 400,
        "is_ambient": false,
        "show_particles": false,
        "show_icon": true
    }
]

An Array of status effect instances with the Slowness I and Slow Falling I status effects that lasts for 20 seconds.

"effect": {
    "effect": "minecraft:speed",
    "duration": "100 + health * 10",
    "amplifier": "clamp(my_pack:mana / 10, 0, 3)"
}

Speed whose duration scales with the target’s current health and whose level is driven by a apoli:resource value, capped at Speed IV.