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

Pick Block on a banner or creating a banner with loom produces an item with different nbt than when it is mined

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.19.2
    • None
    • MacOS 13.0
      JDK 17
    • Unconfirmed
    • (Unassigned)

      Pick block on a banner gives an item with id tag in BlockEntityTag in its nbt data. Creating a banner with the loom also give a banner with id tag in BlockEntityTag in its nbt data. Mining the banner gives an item without the id tag in BlockEntityTag in its nbt data. This results in two stacks of the effectively same banner when picking block on a banner while you have the banner in your inventory.

      Code Analysis

      The loot table of banners only copy the patterns tag

      while pick block uses

      BlockItem.setBlockEntityNbt()

      which adds the id tag to BlockEntityTag

      Suggested Fix

      Add

      {
          "op": "replace",
          "source": "id",
          "target": "BlockEntityTag.id"
      }, 

      to "ops" as seen here

        1. suggested_fix_copy_id.png
          suggested_fix_copy_id.png
          83 kB
        2. pick_block.png
          pick_block.png
          1.03 MB
        3. pick_block_write_id.png
          pick_block_write_id.png
          87 kB
        4. mined.png
          mined.png
          1.16 MB
        5. mined_copy_nbt.png
          mined_copy_nbt.png
          47 kB

            Unassigned Unassigned
            Kevinthegreat Kevin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: