Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 72
Attachments
Comments 46
Underlying cause is MC-21433 (which is WIA :/)
That is not quite the problem here as the block is placed. The problem is that the client always asumes that it interacted with the fence whereas the server does not behave like this and places the block.
Sorry, yes you are right. I thought they acted the same way iron doors or trapdoors act.
Mods please do not close this report as a duplicate because then we have an unnecessary discussion about whether or not it is WAI and like @unknown said it is definitely not.
I would suggest fixing it by having client and server call the method net.minecraft.item.ItemLead.attachToFence(EntityPlayer, World, BlockPos)
but change this method to only create the LeashKnot and leash the entity server-side.
Note: The method net.minecraft.item.ItemLead.onItemUse(ItemStack, EntityPlayer, World, BlockPos, EnumHand, EnumFacing, float, float, float)
contains kind of dead code because if the player successfully interacts with a block it will not use the item. If the player fails right clicking while holding a leash, this method will fail as well.
Can confirm.