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

The minecraft:item.bundle.remove_one sound plays even when no items are unpacked from bundles

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • None
    • 1.18, 1.18.1, 22w03a, 22w05a, 22w06a, 1.18.2 Pre-release 1, 1.18.2, 22w12a, 22w15a, 1.19, 1.19.1, 1.19.2, 22w44a, 1.19.3
    • Confirmed
    • Sound
    • Low

    Description

      The Bug:

      The minecraft:item.bundle.remove_one sound, otherwise known as the "Item unpacked" sound, plays even when no items are unpacked from bundles.

      Steps to Reproduce:

      1. Give yourself a bundle by using the command provided below.
        /give @s minecraft:bundle
      2. Open your inventory, hold the bundle with your mouse cursor, right-click, and listen closely as you do this.
      3. Take note as to whether or not the minecraft:item.bundle.remove_one sound plays even when no items are unpacked from bundles.

      Observed Behavior:

      A sound can be heard even when not unpacking items.

      Expected Behavior:

      A sound would only be heard when items are unpacked.

      Code Analysis:

      Tentative code analysis by Avoma can be found below.

      The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

      net.minecraft.world.item.BundleItem.java
      public class BundleItem extends Item {
         ...
         public boolean overrideStackedOnOther(ItemStack $is, Slot $s, ClickAction $ca, Player $p) {
            if ($ca != ClickAction.SECONDARY) {
               return false;
            } else {
               ItemStack itemstack = $s.getItem();
               if (itemstack.isEmpty()) {
                  this.playRemoveOneSound($p);
                  ...

      If we look at the above class, we can see that if you were to attempt to right-click on an empty inventory slot whilst holding a bundle with your mouse cursor, the playRemoveOneSound() method would be called. This method plays the minecraft:item.bundle.remove_one sound and since no checks are carried out to see whether or not the bundle held by the mouse cursor has items inside of it, this results in the sound being played even when items aren't unpacked from bundles.

      Attachments

        1. MC-244948.mp4
          3.66 MB
        2. MC-244948.png
          MC-244948.png
          844 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Avoma [Helper] Avoma
              Votes:
              5 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                CHK: