Unable to place blocks on fences from off-hand
The bug
Blocks cannot be placed on fences with the off-hand.
How to reproduce
- Hold torch in offhand
- Right click on top of a fence
- 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
is duplicated by12
relates to6
- Fixed
[Mod] AsteraothRutger van aert
[Mojang] Cory Scheviak- 33
- 10
- Confirmed
- (Unassigned)
- fence off-hand
15w31b - 19w41a
15w31b 15w31c 15w32c 15w33b 15w33c 15w44b 15w49b 16w03a 1.9.2 16w15b 1.9.4 16w20a 1.10-pre1 1.10.2 16w39a 16w42a 1.11 1.11.2 17w13b 17w16a 17w16b 17w18b 1.12-pre1 1.12.1 1.12.2-pre1 1.12.2-pre2 1.12.2 17w45b 18w07a 18w11a 18w20c 18w22c 1.13-pre1 1.13-pre2 1.13-pre5 1.13-pre7 1.13-pre8 1.13 18w30a 18w30b 18w31a 1.13.1 1.13.2 18w43b 18w45a 18w46a 18w47b 18w48a 18w48b 18w49a 18w50a 19w02a 19w03a 19w03b 19w03c 19w04a 19w04b 19w05a 19w06a 19w07a 19w08b 19w09a 19w11a 19w11b 19w12a 19w12b 19w13a 19w13b 19w14a 19w14b 1.14-pre1 1.14-pre2 1.14-pre3 1.14-pre5 1.14 1.14.1-pre1 1.14.1 1.14.2 1.14.3-pre1 1.14.3-pre2 1.14.3-pre3 1.14.3-pre4 1.14.3 1.14.4-pre1 1.14.4-pre2 1.14.4-pre3 1.14.4-pre4 1.14.4-pre5 1.14.4-pre6 1.14.4-pre7 1.14.4 19w34a 19w35a 19w37a 19w38b 19w38a 19w39a 19w40a 19w41a- 16w39c 19w42a
Created Issue:
can't place torches on fences while holding torches n my second hand
Put the summary of the bug you're having here
*What I expected to happen was to just place the torch on top of the fence
*What actually happened was
I could not place it on top of the fence. It is just like you right click on a fence whitout having anthing in your handsSteps to Reproduce:
1. Hold the torch in your hand.
2. Press: F
3. Right click on top of a fence
4. You can't place it.
Idea: maybe if you Shift click you can place it?Environment
Windows 10 (don't know java version exactly
relates to
is duplicated by
is duplicated by
is duplicated by
is duplicated by
is duplicated by
duplicate of
MC-86447
can'tplacetorches on fenceswhile holding torches n my secondhandUnable to place blocks on fences from offhand
Put the summary of the bug you're having here
*What I expected to happen was to just place the torch on top of the fence
*What actually happened was
I could not place it on top of the fence. It is just like you right click on a fence whitout having anthing in your handsSteps to Reproduce:
1. Holdthetorch inyourhand.
2. Press: F
3. Right click on top of a fence
4. You can't place it.
Idea: maybe if you Shift click you can place it?Steps to Reproduce:
1. Hold torch in offhand
2. Right click on top of a fence
3. You can't place itIdea: maybe if you Shift click you can place it?
relates to
is duplicated by
is duplicated by
is duplicated by
is duplicated by
is duplicated by
Windows 10 (don't know java version exactly
Windows 10
Windows 10
Steps to Reproduce:
1. Hold torch in offhand
2. Right click on top of a fence
3. You can't place itIdea: maybe if you Shift click you can place it?
Steps to reproduce
- Hold torch in offhand
- Right click on top of a fence
- 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. This can be fixed by removing the check (it serves no real purpose) and having the method return false if the player does not leash an entity to the fence.Fix
BlockFence.javapublic boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { return ItemLead.attachToFence(playerIn, worldIn, pos); } // else // { // ItemStack itemstack = playerIn.getHeldItem(hand); // return itemstack.getItem() == Items.LEAD || itemstack.isEmpty(); // } return false; }
Steps to reproduce
- Hold torch in offhand
- Right click on top of a fence
- 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. This can be fixed by removing the check (it serves no real purpose) and having the method return false if the player does not leash an entity to the fence.Fix
BlockFence.javapublic boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { return ItemLead.attachToFence(playerIn, worldIn, pos); } // else // { // ItemStack itemstack = playerIn.getHeldItem(hand); // return itemstack.getItem() == Items.LEAD || itemstack.isEmpty(); // }return false; }Steps to reproduce
- Hold torch in offhand
- Right click on top of a fence
- 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. This can be fixed by removing the check (it serves no real purpose) and having the method return false if the player does not leash an entity to the fence.Fix
BlockFence.javapublic boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { return ItemLead.attachToFence(playerIn, worldIn, pos); } // else // { // ItemStack itemstack = playerIn.getHeldItem(hand); // return itemstack.getItem() == Items.LEAD || itemstack.isEmpty(); // } ++ return false; }
Steps to reproduce
- Hold torch in offhand
- Right click on top of a fence
- 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.This can be fixed by removing the check (it serves no real purpose) and having the method returnfalse if the player does not leash an entity to the fence.Fix
BlockFence.javapublic boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { return ItemLead.attachToFence(playerIn, worldIn, pos); } // else // { // ItemStack itemstack = playerIn.getHeldItem(hand); // return itemstack.getItem() == Items.LEAD || itemstack.isEmpty(); // } ++ return false; }
Stepsto reproduce
- Hold torch in offhand
- Right click on top of a fence
- 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.The bug
Blocks cannot be placed on fences with the off-hand.
How to reproduce
- Hold torch in offhand
- Right click on top of a fence
- 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.
is duplicated by
[Mod] Asteraoth, ticket is yours now. You can now update the affected version yourself.
is duplicated by
relates to
is duplicated by
relates to
Dupe of MC-83998
Updated MC-83998.
Also, see MC-83998
Thank you for your report!
We're actually already tracking this issue in MC-83998, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki
Please only report one bug per ticket, and search before posting. Some quick searches revealed tickets for almost every issue mentioned in the video, and some of these are already resolved.
See:
MC-6579
MC-4641
MC-8004
MC-93631
MC-9553
MC-19764
MC-83998
MC-118095
MC-116293
MC-125360
MC-121387
MC-127970
MC-145311
MC-131122
MC-134162
MC-140819
MC-123183
MC-145944
MC-147884
MC-94013



Likely caused by fences having a right click action (for leashes).
Confirmed for 16w03a
It affects all blocks.
Confirmed for
When you hold SHIFT you are able to place the block, however for the mainhand this is not the case, see
MC-93651Same reason as for
MC-93651The 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
Confirmed for 16w20a
Confirmed for 1.10-pre1
Confirmed for 1.10.2, Java version.
Looks like it is fixed in 16w39c probably because
MC-93651was fixedThis is not fixed for me in 16w42a.
Confirmed for 1.11
Confirmed for 17w13b
Confirmed for 17w16b
Confirmed for 17w18b
Confirmed for 1.12-pre1
Confirmed for 1.12.2
Confirmed for 17w45b
Confirmed for 18w07a
Confirmed for 18w11a
Fixed in 18w20c, you can shift right click and place blocks on the fence.Not fixed, that's the way it's always been.
Confirmed for 18w22c
Confirmed for 1.13-pre2
Confirmed in 1.13.2
Confirmed for 18w48a
Confirmed for 18w48b
Confirmed for 18w49a
Confirmed for 18w50a
Confirmed for 19w02a
Confirmed for 19w03a
Confirmed for 19w03b
Confirmed for 19w03c
Comfirmed for 19w04a
Confirmed for 19w05a
Confirmed for 19w06a
Confirmed for 19w07a
Confirmed for 19w09a
Confirmed for 19w11a
Confirmed for 19w11b
Confirmed for 19w12a
Confirmed for 19w12b
Confirmed for 19w13a
Confirmed for 19w13b
Confirmed for 19w14a
Confirmed for 1.14 pre-1
Confirmed for 1.14 pre-2
Confirmed for 1.14 pre-3
Confirmed for 1.14 pre-4
Confirmed for 1.14 pre-5
Confirmed for 1.14
Confirmed for 1.14.1 pre-1
Confirmed for 1.14.1 pre-2
Confirmed for 1.14.1
Cannot reproduce in 19w42a, probably fixed
Confirmed fixed in 19w42a