Skip to content

[Version 4.10] Advancement

Insane96 edited this page May 25, 2024 · 2 revisions

Advancements can be used as a condition for mobs properties.

Advancement

  • advancements: (Resource location list) of advancements to be completed.
  • player_mode: (String) Which player should be targeted to check if the advancements are done?
    • "nearest": When a mob spawns the advancements are checked only for the nearest player. Default if omitted.
    • "any": When a mob spawns the advancements are checked for any player in a 128 blocks radius

Note

Multiple advancments in advancements work as an AND condition. All the advancements in the list must be fulfilled.

Examples

This example makes Skeletons get Resistance II when the player has defeated the Ender Dragon.

{
    "target": "minecraft:skeleton",
    "potion_effects": [
        {
            "id": "minecraft:resistance",
            "amplifier": 1,
            "ambient": true
        }
    ],
    "conditions": {
        "advancements_unlocked": [
            {
                "advancements": [ "minecraft:end/kill_dragon" ],
                "player_mode": "any"
            }
        ]
    }
}

This example makes Skeletons get Resistance II when the player has either defeated the Ender Dragon OR summoned the Wither.

{
    "target": "minecraft:skeleton",
    "potion_effects": [
        {
            "id": "minecraft:resistance",
            "amplifier": 1,
            "ambient": true
        }
    ],
    "conditions": {
        "advancements_unlocked": [
            {
                "advancements": [ "minecraft:end/kill_dragon" ],
                "player_mode": "any"
            },
            {
                "advancements": [ "minecraft:nether/summon_wither" ],
                "player_mode": "any"
            }
        ]
    }
}

This example makes Skeletons get Resistance II when the player has defeated the Ender Dragon AND summoned the Wither.

{
    "target": "minecraft:skeleton",
    "potion_effects": [
        {
            "id": "minecraft:resistance",
            "amplifier": 1,
            "ambient": true
        }
    ],
    "conditions": {
        "advancements_unlocked": [
            {
                "advancements": [ "minecraft:end/kill_dragon", "minecraft:nether/summon_wither" ],
                "player_mode": "any"
            }
        ]
    }
}
Clone this wiki locally