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

using_item advancement trigger keeps being activated even after the item stops being used, after teleporting to another dimension

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w33a
    • 1.21
    • None
    • Confirmed
    • Advancements, Data Packs
    • Normal
    • Platform

      The using_item advancement keeps trigger even when the player isn't holding down right mouse button if the reward function has a command that let the player teleport through dimension, causing the player to be stuck at a position unless they no longer holding the item.

      The advancement:

      {
          "criteria":
          {
              "book":
              {
                  "trigger": "minecraft:using_item",
                  "conditions":
                  {
                      "item":
                      {
                          "items": "minecraft:book"
                      }
                  }
              }
          },
          "rewards":
          {
              "function": "test:book"
          }
      }
      

      The function:

      advancement revoke @s only test:book
      execute in overworld run tp @s 0 -60 0 0 0
      playsound entity.player.teleport
      

      What I expected to happen was:
      The advancement stop trigger when release right mouse button.

      What actually happened was:
      The advancement keeps trigger and execute the reward function none-stop.

      Steps to Reproduce:
      1. Put the following datapack into your world and /reload it.
      2. Use the following command to get an edible book.

      /give @s book[food={can_always_eat: true, eat_seconds: 86400, nutrition: 1, saturation: 1}]
      

      3. Go to the nether.
      4. In the nether, start using the book until you appear in the overworld.
      5. You will be teleported back to the overworld, and stuck at (0, -60, 0) until you use the book again or switch to another hotbar slot.

        1. MC-274372.zip
          0.7 kB
        2. Bug.mp4
          6.94 MB

            rebeccakullenius [Mojang] Rebecca
            AC Alex Cai
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: