mojira.dev
MCPE-152556

Players can pick block to replace an item with "minecraft:item_lock" component

When an item with the "minecraft:item_lock" component is given to a player in creative mode, they can replace it using the pickblock function (middle mouse button by default).
This doesn't feel consistent with how they are not able to move the item in any other way. It can't be dropped, moved or replaced by clicking on it otherwise.

Reproduction steps:

  1. Switch to creative mode /gamemode c

  2. Use this command to get an item locked in the first slot
    /replaceitem entity @s slot.hotbar 0 wool 1 0 {"minecraft:item_lock": {"mode":"lock_in_slot"}}

  3. Use this command to fill your hotbar with other items, so pickblock is forced to try and replace the current slot /give @s diamond_shovel 8

  4. Scroll to the first slot and use pickblock on the ground
    ❌ -> The locked wool block item gets replaced by a new block

Linked issues

Comments 1

Issue is not exclusive to creative mode. It also occurs in survival and adventure mode, if the block being pickblocked is in the player's inventory. This could break custom maps.

Maxaxik

(Unassigned)

724312

Confirmed

Windows

1.18.20.27 Beta, 1.18.12 Hotfix, 1.21.31 Hotfix, 1.21.41 Hotfix, 1.21.93 Hotfix

Retrieved