Ive been working on a map of mine and had accidentally killed all my item frames with kill @e =\ (forgot item frames were an entity for a second when trying to clear all spawned mobs.)
they used to be invulnerable using the following command:
You can get around the one entity limit by using /execute like so:
/execute at @e[type=item_frame,distance=..100] run data merge entity @e[limit=1,sort=nearest] {Invulnerable:1b}
To save time and space, instead you could do
/execute at @e[type=item_frame,distance=..100] run data merge entity @s {Invulnerable:1}
Also to the OP, Invulnerability does not protect your item frames against /kill @e, if you dont wan't to kill your item frames do /kill @e[type=!player,type=!item_frame]
Hello.
Ive been working on a map of mine and had accidentally killed all my item frames with kill @e =\ (forgot item frames were an entity for a second when trying to clear all spawned mobs.)
they used to be invulnerable using the following command:
"/entitydata @e[type=ItemFrame,r=100] {Invulnerable:1b}"
The /entitydata command no longer exists and i cant seem to select multiple item frames with the /data command.
Does anyone know of a way to do this in the current updates?
You can get around the one entity limit by using /execute like so:
Thank you very much, this works exactly like i need it to.
No problem, I'm glad to be able to help
To save time and space, instead you could do
/execute at @e[type=item_frame,distance=..100] run data merge entity @s {Invulnerable:1}
Also to the OP, Invulnerability does not protect your item frames against /kill @e, if you dont wan't to kill your item frames do /kill @e[type=!player,type=!item_frame]
In regard to @s, I actually tried doing that in my test world but it never actually changed the Invulnerable tag.
Have you tested that and found it to work? I'm curious.
I have tried that with the NoAI tag with sheep, it worked. I also have a world where all iron golems have the health of 50 with that command
Interesting, I'll have to see if I messed up the syntax. Thanks for the feedback!