mojira.dev
MC-83337

Eye of Ender in the mainhand doesn't block offhand item usage

When one has an eye of ender in their main hand and a placeable block in their off hand, right-clicking will throw the eye of ender and place the block at the same time.

Also happens when you have an ender pearl in the offhand, it is then thrown together with the eye of ender.


Code analysis by @unknown in this comment

Linked issues

Comments

migrated

is this still an issue in 15w44b?

kumasasa

Is this still a concern in the current Minecraft Snapshot 15w44b or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

migrated

Still happens.

shufboyardee

Affects snapshots through 1.9 pre-2.

marcono1234

Please link to this comment in the description

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why this happens is because the net.minecraft.item.ItemEnderEye.onItemRightClick(ItemStack, World, EntityPlayer, EnumHand) method returns always net.minecraft.util.EnumActionResult.FAIL if it is not called by the server. This means for the client alway thinks he could not use the Eye of Ender.

Note: The first part which tests if the block the player is looking at is an end portal frame block is probably not needed as this is already done by the net.minecraft.client.multiplayer.PlayerControllerMP.func_187099_a(EntityPlayerSP, WorldClient, ItemStack, BlockPos, EnumFacing, Vec3d, EnumHand) method.

migrated

Looks like the fix of this caused MC-107185 to be a thing.

migrated

Agnes Larsson

Confirmed

Minecraft 15w31a, Minecraft 15w32c, Minecraft 15w33c, Minecraft 15w34b, Minecraft 15w44b, Minecraft 1.9 Pre-Release 2

Minecraft 16w35a

Retrieved