mojira.dev
MC-244948

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

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 @unknown 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.

Linked issues

Attachments

Comments 3

I am unable to reproduce this in 24w39a.

I'm unable to reproduce this as well in 1.21.2 pre1.

This issue was present in 1.21.1 but no longer occurs in 24w33a. This issue was fixed in 24w33a.

Avoma

(Unassigned)

Confirmed

Gameplay

Low

Sound

bundle

1.18, 1.18.1, 22w03a, 22w05a, 22w06a, ..., 1.19.4, 1.20.1, 1.20.5, 1.20.6 Release Candidate 1, 1.21

24w33a

Retrieved