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

"effects_changed" advancement trigger can be used to give infinite status effects until the player dies

    XMLWordPrintable

    Details

    • Confirmation Status:
      Unconfirmed
    • Category:
      (Unassigned)

      Description

      The bug

      When using an effects_changed advancement that runs a reward function when granted, it can be used to give the player a status effect of an infinite duration when that same effect is given and then cleared beforehand. The status effect is then removed when the player dies.

      The bug cannot be reproduced if there are other status effects given to the player in the process.

      How to reproduce

      1. Create an effects_changed advancement with a reward function:
        {
          "criteria": {
            "effects_changed": {
              "trigger": "effects_changed"
            }
          },
          "rewards": {
            "function": "game:effects_changed"
          }
        }
        
      2. Create a reward function for the advancement:
        advancement revoke @s only game:effects_changed
        effect give @s strength 30 127
        
      3. Use /effect give @s strength 30 127 to get a Strength effect with the same duration and amplifier as the one in the function.
      4. Use /effect clear or a Milk Bucket to clear the effect.
        The effect is cleared and then given again to the player.
      5. Repeat the previous procedure.
        The effect is no longer cleared, and a "Target has no effects to remove" error message is shown when using the command.
      6. Observe the effect when it reaches a duration of 00:00.
        The effect remains and cannot be cleared even when re-logging the world.
      7. Use /kill to kill the player.
        The effect is removed.

      Data pack

      A data pack is provided below for easier reproduction.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            BoyrexMacaraya Alireza Macaraya
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: