The bug
If you try put an item or a block in an item frame with the off-hand if you have nothing in you main hand, nothing happens.
Code analysis
Based on 1.11 decompiled using MCP 9.35 rc1
The problem is that the method net.minecraft.entity.item.EntityItemFrame.processInitialInteract(EntityPlayer, EnumHand)
always returns true
even if the no item was placed nor the item in the item frame was rotated. This makes the game skip the offhand. The check whether or not the world is a server world has to be removed as well because otherwise the client would always try to interact with both hands because it would always fail.
Fix
EntityItemFrame.java
public boolean processInitialInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
// if (!this.world.isRemote)
// {
if (this.getDisplayedItem().isEmpty())
{
if (!itemstack.isEmpty())
{
this.setDisplayedItem(itemstack);
if (!player.capabilities.isCreativeMode)
{
itemstack.shrink(1);
}
++ return true;
}
++ return false;
}
else
{
this.playSound(SoundEvents.ENTITY_ITEMFRAME_ROTATE_ITEM, 1.0F, 1.0F);
this.setItemRotation(this.getRotation() + 1);
}
// }
return true;
}
Linked issues
is duplicated by 1
Attachments
Comments 6
But if you have nothing in your main hand and something in your off-hand , we should be able to put it in the item frame.
Ps: Sorry for the spelling, I'm French ^^
I think that if the "use" button is pressed, the main slots are issued first, then if the main slots don't have an action it issues the command to the off-hand slot. Maybe it's just thinking that your hand has an item?