mojira.dev
MC-65931

The pick block function doesn't work with entities while in survival or adventure mode

The Bug:

The pick block function doesn't work with entities while in survival or adventure mode.

Using the pick block function on a block in survival or adventure mode would switch your hotbar selection to that block if you have it present in your inventory. This isn't the case for entities such as item frames, boats, paintings, minecarts, armor stands, end crystals, etc...

Steps to Reproduce:

  1. Obtain two item frames and switch into survival mode.

  2. Place one of them down and begin holding anything other than the item frame in your inventory.

  3. Use the pick block function whilst looking at the item frame you just placed.

  4. Take note as to whether or not the pick block function works with entities while in survival or adventure mode.

Observed Behavior:

The pick block function doesn't work.

Expected Behavior:

The pick block function would work.

Linked issues

Attachments

Comments 20

The Armor Stand part is a bug for all game modes.

Armor stand works for creative in 15w45a

Armor stands ended up getting their own ticket.

Please do not mark unreleased versions as affected.
You don't have access to them yet.

Confirmed for 1.12-pre5

10 more comments

Can confirm this behavior in 21w40a. Here are some extra details regarding this problem.

The Bug:

The pick block function doesn't work with entities whilst in survival or adventure mode.

Steps to Reproduce:

  • Obtain two item frames and switch into survival mode.

  • Place one of them down and begin holding anything other than the item frame in your inventory.

  • Use the pick block function whilst looking at the item frame you just placed, and take note as to whether or not you are now holding an item frame in your hand.

Observed Behavior:

The pick block function doesn't work with entities whilst in survival or adventure mode.

Expected Behavior:

The pick block function would work with entities whilst in survival or adventure mode.

it doesn't work due to a redundant check in the net.minecraft.client.MinecraftClient class, method doItemPick()
For blocks it checks if (type = HitResult.Type.BLOCK)
For entities it checks if (type = HitResult.Type.ENTITY|| !bl)
where bl is only true when the player is in creative mode.

bl is still used later in the code to see if the player can pull items out of creative inventory, but please, remove it from the entity check, im begging

Can confirm in 24w33a.

This issue was fixed in Minecraft snapshot 24w44a due to a refactor involving the pick item functionality.

Can confirm that this issue was fixed in 24w44a.

Ccosenza

Avoma

(Unassigned)

Confirmed

Platform

Normal

Player

Minecraft 1.7.10, Minecraft 14w32b, Minecraft 14w32d, Minecraft 14w33a, Minecraft 14w33c, ..., 1.21, 1.21.1, 24w33a, 24w44a, 1.21.3

24w44a

Retrieved