4

How can I have item frames right in front of a player, and still keep them from stealing the items from the item frame(s)? [I don't want to have to use the /clear command to just clear the item from the player's inventory when they obtain it.]

1
  • Wait, ignore my last comment. I forgot it only works if you are on a server with protection. Jan 30, 2016 at 5:01

3 Answers 3

7

You can set Invulnerable to true to prevent an item frame from both providing the player with an item as well as preventing the player from breaking the item frame by punching it.

/entitydata @e[type=ItemFrame,c=1] {Invulnerable:1b}
0

For people wanting to make all item frames invincible, just use

/execute as @e[type=minecraft:item_frame] run data merge entity @s {Invulnerable:1b}

-2

Put the player in adventure mode. Players in adventure mode are not able to break item frames. Breaking entities in adventure was a bug and is resolved based on the bug tracker.

1
  • 4
    That bug is resolved as "Working as Intended", not "Fixed". Adventure mode players can still break item frames.
    – Skylinerw
    Jan 30, 2016 at 7:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .