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
relates to 1
Comments 4
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;
}
};
Affects
dragon_head
,creeper_head
,zombie_head
,player_head
andskeleton_skull
. Does not affectwither_skeleton_skull
.