Skip to content

[1.12] Potion Effects

Insane96 edited this page Jul 9, 2022 · 2 revisions

You can add potion effects by using the object array "potion_effects".

Simple Example

This example will make creepers have 15% chance to get Resistance I on spawn.

{
    "mob_id": "minecraft:creeper",
    "potion_effects": [
        {
            "id": "minecraft:resistance",
            "chance": {
                "amount": 15
            },
            "amplifier": {
                "min": 0,
                "max": 0
            }
        }
    ]
}

Potion Effect ("potion_effects")

That's a list of all the keys available for the potion_effect object, if (optional) is not present then the key is REQUIRED.

  • id: id of the potion effect
  • chance (Object): percentage chance to apply the potion effect.
  • amplifier: min and max values for the potion effect level. Remember that levels start from 0, so amplifier 0 is potion effect level 1, amplifier 1 = potion level 2, etc. (
    • min: min potion level
    • max: max potion level, inclusive (can be equal to min)
  • ambient: (true/false) should particles be barely visible, like the ones you get from the beacon effects (optional, defaults to false)
  • hide_particles: (true/false) should particles be hidden? (optional, defaults to false)
  • dimensions: a list of dimensions ids (0 = overworld, -1 = nether, 1 = end) where this potion effect should be applied. (optional, if omitted the potion effect will be applied no matter in what dimension)
  • biomes (optional): a list of biome ids (if modded biomes the mod namespace must be specified, e.g. "traverse:autumnal_forest") where this attribute modifier should be applied if the mob spawns in this listed biomes. (if omitted the attribute modifier will be applied no matter in what biome)

Example

This example has 15% chance to give Regeneration from I to II to Creepers, while particles are barely visible. Plus 15% chance to give them Resistance I while particles will not be visible. Plus 7.5%/15%/30% (in Easy/Normal/Hard) chance to get Speed I. Plus 30% multiplied by local difficulty, multiplied by 2, chance to get Fire Resistance if the creeper spawns in the Nether.

{
    "mob_id": "minecraft:creeper",
    "potion_effects": [
        {
            "id": "minecraft:regeneration",
            "chance": {
                "amount": 15
            },
            "amplifier": {
                "min": 0,
                "max": 1
            },
            "ambient": true
        },
        {
            "id": "minecraft:resistance",
            "chance": {
                "amount": 15
            },
            "amplifier": 0,
            "hide_particles": false
        },
        {
            "id": "minecraft:speed",
            "chance": {
                "amount": 15,
                "affected_by_difficulty": true
            },
            "amplifier": 0
        },
        {
            "id": "minecraft:fire_resistance",
            "chance": {
                "chance": 30.0,
                "is_local_difficulty": true,
                "multiplier": 2.0
            },
            "amplifier": 0,
            "dimensions": [-1]
        }
    ]
}
Clone this wiki locally