The bug
Dispensers play the dispensing failed sound when they equip a single pumpkin or skull.
How to reproduce
Activate subtitles
Put a stack of multiple pumpkins or skulls 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 pumpkin or skull in the dispenser and unequip the one you are currently wearing
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
clones 1
relates to 2
Comments 9
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?
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.
Can confirm for MC 1.12.1.