mojira.dev
MC-163879

Dispenser plays failed sound when equipping a single mob head

The bug

Dispensers play the dispensing failed sound when they equip a mob head but it not affect wither skeleton head.

How to reproduce

  •  Activate subtitles

  •  Put a single wither skeleton head in a dispenser

  •  Stand in front of the dispenser and activate it

->✔  It will play the sound when an item was successfully dispensed and show the subtitle "Dispensed item"

  • Put only a single mob head except wither skeleton head in the dispenser

  • Stand in front of the dispenser and activate it

->❌  It will play the sound when an item was not successfully dispensed and show the subtitle "Dispenser failed"

Code Analysis

Code analysis by @unknown can be found in this comment.

Linked issues

Comments 4

Affects dragon_head, creeper_head, zombie_head, player_head and skeleton_skull. Does not affect wither_skeleton_skull.

The code for Items.WITHER_SKELETON_SKULL and Blocks.CARVED_PUMPKIN in net/minecraft/core/dispenser/DispenseItemBehavior is changed from

ItemStack itemStack7 = ArmorItem.dispenseArmor(blockSource, itemStack);
if (itemStack7.isEmpty()) {
   this.success = false;
}

to

ItemStack itemStack7 = ArmorItem.dispenseArmor(blockSource, itemStack);
if (itemStack.getCount() < itemStack7.getCount()) {
   this.success = false;
}

to fix MC-114106 in 19w42a.

However, this is not changed for other heads/skull items.

DispenseItemBehavior dispenseItemBehavior3 = new OptionalDispenseItemBehavior() {
   @Override
   protected ItemStack execute(final BlockSource blockSource, final ItemStack itemStack) {
      this.success = !ArmorItem.dispenseArmor(blockSource, itemStack).isEmpty();
      return itemStack;
   }
};

Fixed in 1.15 pre3.

Yes confirmed, fixed in 1.15-pre3.

TheBoy358

(Unassigned)

Confirmed

Sound

1.14.4, 19w42a, 19w44a, 19w45a, 19w45b, 19w46a, 19w46b, 1.15 Pre-release 1, 1.15 Pre-Release 2

1.15 Pre-release 3

Retrieved