-
Bug
-
Resolution: Unresolved
-
None
-
1.21.4
-
None
-
Unconfirmed
-
Data Packs
The bug
Duplicated use of player_hurt_entity criterion that can be met simultaneously under an OR clause causes the advancement to trigger multiple times.
How to reproduce
- Write an advancement that has multiple criterion triggered by a single action under an OR clause.
"requirements": [ [ "player_attack_damage", "melee_damage", "player_attack_damage_2" ] ],
- Write a reward function that checks which criterion are met and revokes the advancement after achieved.
execute as @s[advancements={test:monster_attack={player_attack_damage=true}}] run tellraw @a "player_attack_damage criteria triggered" execute as @s[advancements={test:monster_attack={player_attack_damage_2=true}}] run tellraw @a "player_attack_damage_2 criteria triggered" execute as @s[advancements={test:monster_attack={melee_damage=true}}] run tellraw @a "melee_damage criteria triggered" execute as @s[advancements={test:monster_attack=true}] run tellraw @a "Advancement triggered" advancement revoke @s only test:monster_attack
- Create a new world and load the datapack.
- Trigger the advancement by hitting a mob once.
- Check the result.
Expected behaviour: The advancement is triggered only once, being able to check that all criterion are met at the same time in its reward function.
Actual result: The advancement is triggered multiple times seperately, indicating that only one of the criterion listed is met each time.
An example datapack and the result after following these steps with it are attached below.