Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-163988

Item event response 'run_command' with '/clear' or '/replaceitem' does not change held item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.40, 1.20.0
    • None
    • Confirmed
    • Windows
    • 932294

      The bug

      In data-driven items there is an event response named 'run_command' that can run any command. Both the /clear and the /replaceitem commands cannot change the player's held item, however.

      Note that the attached behavior pack is purely for demonstration purposes only. There are better means to replace the held item with air, but this method using run_command should work.

      Steps to reproduce:

      • Create a world with the Holiday Creator Features experiment enabled, or use an existing world.
      • Download the attached behavior pack and apply it to the world. This gives an item that will run a command to replace the held item with air when used.
      • Give yourself the item and hold use for at least one second.

      The item is still in your hand. Note that your name printed to chat, proving that the event was successfully called.

            Sprunkles Sprunkles
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: