-
Bug
-
Resolution: Unresolved
-
None
-
1.19.2, 1.20.4, 24w03b
-
None
-
Confirmed
-
Data Packs
The Bug:
The behavior for the `effects_changed` advancement trigger is inconsistent when specifying an effect in the `effects` condition, and detects it upon ending via natural causes.
Observed:
In this example, I've used an advancement to detect the change of the invisibility effect (shown below) that links to a function that prints a message in chat. The message displays when I receive the effect (potion or command) and when I manually clear the effect (milk or command). The message does not display (aka effect change is not detected) when the effect runs out naturally.
If in the advancement trigger, no effect is specified, it will detect the effect changing no matter if it was given (potion or command), manually taken (milk or command), or naturally runs out.
Expected:
When an effect runs out, the `effects_changed` advancement trigger should detect it if it is specified in the `effects` condition, just like it does if no effect is specified.
Notes:
My guess is that when the effect is manually removed, the player is checked for what effects they have right before the effect is removed. But when the player naturally runs out of effects, the game checks right after the effect is removed, meaning the condition for the trigger is not valid.
The advancement used in my testing is printed below. An example datapack and video is attached as well.
{ "criteria": { "requirement": { "trigger": "minecraft:effects_changed", "conditions": { "effects": { "minecraft:invisibility": {} } } } } }