I recently saw that there is a part of code intended to make spawn eggs work on fences so that the mob stands on top of the fence.
It looks like that:
ItemSpawnEgg.java (ItemMonsterPlacer.java in MCP)
...
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
...
IBlockState var9 = worldIn.getBlockState(pos);
...
// It's supposed to check if the block it was placed one is a fence. How ever it's checking the BlockState, not the block.
// What was meant to be done is var9.getBlock() instead of just var9.
if(side == EnumFacing.UP && var9 instanceof BlockFence) {
// Offset for the spawn
var13 = 0.5D;
}
...
}
...
Better fix
As seen in the code snippet there is just a .getBlock() missing.
However when fixing this you could also make the offset (here var13) depended on the collision box of the block.
Then it would work for fence gates, cobble walls and also for slabs and so on too.
Video: https://youtu.be/ZkI3uU7hoBA?t=1m09s
This post might be seen as related: MC-65951
Related issues
is duplicated by
relates to
Attachments
Comments


MC-64953 (which describes the same issue but with much less info) shows that the problem has been occurring since at least 14w31a.
Confirmed for 15w46a
Screenshot
Confirmed for 15w47b

Confirmed for 15w51b.

Confirmed for 16w05b.

Confirmed for 1.9.3-pre3.

Confirmed for 1.9.4.

Confirmed for 16w20a.

Confirmed for 16w21a.

Confirmed for 16w21b.

Confirmed for 1.10-pre1.

Confirmed for 1.10-pre2.

Confirmed for 1.10.

Confirmed for 1.10.1.