-
Notifications
You must be signed in to change notification settings - Fork 4
Unique Criteria
Draylar edited this page Jan 22, 2022
·
1 revision
By using the advancement system, you can tap into powerful criteria that allow you to grant Phases under certain circumstances. How about gating Enchanted Golden Apples until the player has eaten a regular Golden Apple?
onEvent('gamephases.initialize', event => {
// Side Phase - prevent players from using Enchanted Golden Apples until they have eaten a Golden Apple.
// The 'eaten a Golden Apple' unlock part comes in with the advancement.
event.phase('yummy_gold')
.item('minecraft:enchanted_golden_apple');
});
{
"parent": "gamephases:phases/root",
"rewards": {
"phases": [
"yummy_gold"
]
},
"criteria": {
"eaten_golden_apple": {
"trigger": "minecraft:consume_item",
"conditions": {
"item": {
"items": [
"minecraft:golden_apple"
]
}
}
}
},
"requirements": [
[
"eaten_golden_apple"
]
]
}