mojira.dev
MC-83998

Unable to place blocks on fences from off-hand

The bug

Blocks cannot be placed on fences with the off-hand.

How to reproduce

  1. Hold torch in offhand

  2. Right click on top of a fence

  3. You can't place it

Code analysis

The method net.minecraft.block.BlockFence.onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) returns true if your mainhand is empty or holding a lead. This is also the reason for MC-21433. Since the method returns true when there's nothing in your mainhand, the offhand is ignored.

Linked issues

Attachments

Comments 55

[Mod] redstonehelper

Likely caused by fences having a right click action (for leashes).

Confirmed for 16w03a
It affects all blocks.

Confirmed for

  • 16w15b

When you hold SHIFT you are able to place the block, however for the mainhand this is not the case, see MC-93651

Same reason as for MC-93651

The client thinks it interacted with its mainhand with the fence, and because of this does not try to use the offhand.

Confirmed for 1.9.4

45 more comments
Jack McKalling

Confirmed for 1.14.1 pre-1

Jack McKalling

Confirmed for 1.14.1 pre-2

Jack McKalling

Confirmed for 1.14.1

Cannot reproduce in 19w42a, probably fixed

Jack McKalling

Confirmed fixed in 19w42a

Rutger van aert

Asteraoth

coschevi

Confirmed

(Unassigned)

fence, off-hand

Minecraft 15w31b, Minecraft 15w31c, Minecraft 15w32c, Minecraft 15w33b, Minecraft 15w33c, ..., 19w38b, 19w38a, 19w39a, 19w40a, 19w41a

Minecraft 16w39c, 19w42a

Retrieved