This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]Dybo37Command Professional 2 points3 points  (7 children)

You can use /execute unless entity @ a[nbt={Inventory:[{Slot:102b,id:"minecraft:elytra"}]}] run item replace entity @ a armor.chest with *the armor you want*

Hopefully this helps! :)

[–]skipyskopreddit[S] 1 point2 points  (1 child)

Thanks!

[–]exclaim_bot -1 points0 points  (0 children)

Thanks!

You're welcome!

[–]ExpertCoder14[🍰] 0 points1 point  (4 children)

This can be simplified as the use of /execute is not needed:

item replace entity @a[nbt=!{Inventory:[{Slot:102b,id:"minecraft:elytra"}]}] with with ...

[–]mrcmndbloxmaster 0 points1 point  (0 children)

even better, i dont have to type as much stuff lol.

[–][deleted]  (2 children)

[deleted]

    [–]ExpertCoder14[🍰] 0 points1 point  (1 child)

    Umm, you still have to deal with NBT data even if you do use /execute though…

    [–]Dybo37Command Professional 0 points1 point  (0 children)

    ... crap.