-
Bug
-
Resolution: Invalid
-
None
-
20w21a
-
Unconfirmed
-
(Unassigned)
Background
The effects_changed advancement trigger should work after an effect is given to or taken from the player.
The bug
When using a player predicate in the advancement trigger to attempt to check if a certain effect is taken from the player, it is rather checked before the effect is taken away from them:
{
"criteria": {
"speed": {
"trigger": "effects_changed",
"conditions": {
"player": [
{
"condition": "inverted",
"term": {
"condition": "entity_properties",
"entity": "this",
"predicate": {
"effects": {
"speed": {}
}
}
}
}
]
}
}
},
"rewards": {
"function": "game:effects_changed"
}
}
How to reproduce
- Create an advancement such as the one shown above to check for a certain effect taken from the player.
- Create a reward function for the advancement:
advancement revoke @s only game:give_speed say Hello!
- Use a Potion of Swiftness or /effect give @s speed to get the Speed effect.
- Use a Milk Bucket or /effect clear to clear the effect.
→
The advancement is not granted and the message is not displayed.
Data pack
An attached data pack is provided below for easier reproduction.