mojira.dev
MC-143716

/replaceitem allows incongruous slot types

The bug

The /replaceitem command allows in general incongruous slot types, e.g. you can use inventory.X for a container (where you should use container.X), see MC-143663.
This can result in targeting the wrong slot and the mistake is often not obvious.

The expected behavior would be that the slot is validated based on the targeted entity or block and the command would fail executing if the wrong slot type is used.

How to reproduce

  1. Place a chest

  2. Use inventory.X as slot

    /replaceitem block ~1 ~ ~ inventory.0 stone

    → ❌ The command is executed and the stone is placed in the second row

Linked issues

Comments 0

No comments.

marcono1234

(Unassigned)

Confirmed

Commands

/replaceitem

Minecraft 19w05a

Retrieved