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

Setblock command run by book in lectern to clear inventory run in command block causes ghost items

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.15.2, 1.16.1, 1.16.2 Pre-release 3
    • Fix Version/s: 21w10a
    • Labels:
      None
    • Confirmation Status:
      Confirmed
    • Category:
      Commands

      Description

      When calling setblock from a book (in a lectern or in hand), the block will be set. If a commandblock executing the clear command is being executed by that, ghost items are created only if the book was in a lactern, but not otherwise.

       

      How to reproduce

      Preparation

      Execute these two commands (if necessary, using a commandblock) to get the lectern and the command block:

      Lectern:

      /give @p lectern{BlockStateTag:{has_book:"true"},BlockEntityTag:{Book:{id:written_book,Count:1b,tag:{author:"Summoner",title:"Summoned Book",pages:['{"text":"Set Redstone Block","clickEvent":{"action":"run_command","value":"/setblock ~3 ~ ~ redstone_block"}}']}}}}
      

      Command-Block:

      /give @p command_block{BlockEntityTag:{Command:"clear @p"}}
      

      Stand still. Place the commandblock to the east so that there are 3 spaces between you and the commandblock. (~4 ~ ~) Place the lectern to the east right next to you. (~1 ~ ~)

      Execution

      Click on the lectern, click the text, the redstoneblock will appear, the commandblock's output will tell you "Removed 2 items from player" and you'll have ghost-items in your toolbar.
      Re-Setup.
      Take the book from the lectern, open it while in your toolbar, click the text, the redstoneblock will appear, the commandblock's output will tell you "Removed 2 items from player" and your items will be gone without leaving ghost-items.

       

      This bug seems to be in correlation with MC-154094.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              boq [Mojang] Bartosz Bok
              Reporter:
              ChaosNe0 ChaosNe0
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                CHK: