Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7881

CTRL+Pick Block saves position data into item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Debian GNU/Linux 11 (bullseye) x86_64 5.10.0-23-amd64 

      Intel i5-6600K (4) @ 3.900GHz

    • This server is running CraftBukkit version 4300-Spigot-a759b62-7070de8 (MC: 1.21.1) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
    • Yes

      Background info: In Creative Mode, Pick block (default keybind: MOUSE3 or middle click) is a game control that puts the item version of the block you are looking at in your main hand. Holding down CTRL (or CMD on MacOS) will save the target's block NBT data into this item as well.

      Bug: Using CTRL + Pick block on a chest with at least one item in it will produce an item that also has the "block_entity_data" item component on it along with the saved items. This component has position data pointing to (0, 0, 0).

      What this affects: Saved chest items using this method may be subject to having their inventories replaced with the inventory of any chest at (0, 0, 0) if present

      Steps to reproduce (Method 1):

      1. Place a chest "A" at (0, 0, 0) with any contents.
      2. Place another chest "B" elsewhere containing at least one item
      3. Perform CTRL + Pick Block on chest "B"

      The resulting item will either contain the contents of chest "A" or "B", seemingly non-deterministically. You can check this by placing it down or using the built-in /data command to view its NBT data.

       

      Steps to reproduce (Method 2):

      1. In a Spigot server, perform CTRL + Pick Block on a chest "C" with at least one item in it
      2. Save this item to the Saved Hotbars section of the Creative Inventory
      3. Quit this server and log onto any secondary server (e.g. Spigot, dedicated Vanilla, integrated Singleplayer)
      4. Place a chest "D" at (0, 0, 0), and grab the previously saved chest item from the Creative Menu

      The resulting item will either contain the contents of chest "C" or "D", seemingly non-deterministically. You can check this by placing it down or using the built-in /data command to view its NBT data. Please note that this does not occur if the chest "C" was picked and saved in a non-Spigot (e.g. dedicated Vanilla) server.

       

      In this description I've only mentioned chests specifically, but I've also observed this same behavior with barrels and furnaces; it likely affects every container block type.

       

      I have confirmed (by using /data to view the resulting item in my inventory) that the saving of "block_entity_data" on CTRL+Pick Block does not happen in the integrated vanilla singleplayer server and does not happen in the dedicated vanilla Mojang server.

            md_5 md_5
            holographicftw@gmail.com FullPotato
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: