mojira.dev
MC-114106

Dispenser plays failed sound when equipping a single pumpkin or skull

The bug

Dispensers play the dispensing failed sound when they equip a single pumpkin or skull.

How to reproduce

  1. Activate subtitles

  2. Put a stack of multiple pumpkins or skulls in a dispenser

  3. 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"

  4. Put only a single pumpkin or skull in the dispenser and unequip the one you are currently wearing

  5. 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

Based on 1.11.2 decompiled using MCP 9.35 rc1

The respective methods set the field net.minecraft.init.Bootstrap.BehaviorDispenseOptional.successful to false it the item returned after dispensing is "empty". Instead they should set it to false only if the count did not change.
Additionally the method net.minecraft.item.ItemArmor.dispenseArmor(IBlockSource, ItemStack) should probably return the item if not entity can be equipped instead of returning an empty item.
The method net.minecraft.item.ItemArmor.DISPENSER_BEHAVIOR.new BehaviorDefaultDispenseItem() {...}.dispenseStack(IBlockSource, ItemStack) should then test as well if the count did not change.

Linked issues

Comments 9

Can confirm for MC 1.12.1.

Confirmed for 1.13.1.

Affects 18w47b

Affects 18w48a

It seems this happens when a dispenser places a stack containing a single pumpkin, even if multiple such stacks exist within.

Affects 18w48b, can I request ownership of the ticket?

Affects 18w49a

Affects 18w50a

Blocked by MC-142524 in 19w03b

Fixed for pumpkins but for skull it still not fixed in 19w42a.

I have created a new ticket MC-163879.

Marcono1234

muzikbike

coschevi

Confirmed

(Unassigned)

count, dispenser, equipping, item, pumpkin, skull

Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w20c, ..., 19w34a, 19w35a, 19w36a, 19w37a, 19w38b

19w42a

Retrieved