Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-185546

"effects_changed" advancement trigger checks "player" predicate before an effect is given to or taken from the player

XMLWordPrintable

    • 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

      1. Create an advancement such as the one shown above to check for a certain effect taken from the player.
      2. Create a reward function for the advancement:
        advancement revoke @s only game:give_speed
        say Hello!
        
      3. Use a Potion of Swiftness or /effect give @s speed to get the Speed effect.
      4. 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.

            Unassigned Unassigned
            jirauser283547 user-a4a49 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: