The bug
As of snapshot 15w49a, if you shear a snow golem, you'll be able to remove his pumpkin and see his original face. But the pumpkin isn't dropped in a way that you can get it back.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 1
Attachments
Comments 10
This could well be a bug in both versions. Has a dev actually said/tweeted/whatever that it is intended?
Like I said in the description, maybe the developers have their reasons not to make them drop the pumpkin - maybe so that you couldn't spawn an infinite amount of golems using a single pumpkin. But, in any case, I wanted to make sure it is intended. But if it isn't, it will get fixed.
The following is based on a decompiled version of Minecraft 1.12 using MCP 9.40pre-1.
This happens because the method net.minecraft.entity.monster.EntitySnowman.processInteract()
simply removes the pumpkin from the snow golem's head without dropping it. This can be fixed by invoking the method net.minecraft.entity.dropItem(Item.getItemFromBlock(Blocks.PUMPKIN), 1)
which will make the snow golem drop a pumpkin.
protected boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
if (itemstack.getItem() == Items.SHEARS && this.isPumpkinEquipped() && !this.world.isRemote)
{
this.setPumpkinEquipped(false);
// This line should be added, it will make the snow golem drop a pumpkin when sheared
this.dropItem(Item.getItemFromBlock(Blocks.PUMPKIN), 1);
itemstack.damageItem(1, player);
}
return super.processInteract(player, hand);
}
Relates to MC-189840
In MC:PE it is the same, so it's intended