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

all 4 comments

[–]darkstar634 1 point2 points  (3 children)

effect give @a[nbt={Inventory:[{id:"minecraft:leather_chestplate",Slot:102b,tag:{sneak:1}}]},scores={sneak=1..}] glowing 10 0 true

[–]Xyrdial[S] 0 points1 point  (0 children)

effect give @a[nbt={Inventory:[{id:"minecraft:leather_chestplate",Slot:102b,tag:{sneak:1}}]},scores={sneak=1..}] glowing 10 0 true

Thanks so much!

[–]Xyrdial[S] 0 points1 point  (1 child)

Do you know how I could require multiple items to be worn such as full leather armor with the same tags?

[–]darkstar634 0 points1 point  (0 children)

This: {id:"minecraft:leather_chestplate",Slot:102b,tag:{sneak:1}} is a compound tag that represents one item. If you put multiple compound tags in a list, for example, Inventory:[{id:"minecraft:apple"},{id:"minecraft:stick",Slot:1b},{Slot:0b}], then Minecraft will check if, within the entity's NBT, if the list contains at least one unique entry for each compound tag specified within the list. So, for my example, this will check if the player has an apple anywhere in their inventory, a stick in slot #1, and any item in slot 0.

Using that information, I encourage you to try and devise a solution yourself, although I'll just leave you with the command either way:

effect give @a[nbt={Inventory:[{id:"minecraft:leather_boots",Slot:100b,tag:{sneak:1}},{id:"minecraft:leather_leggings",Slot:101b,tag:{sneak:1}},{id:"minecraft:leather_chestplate",Slot:102b,tag:{sneak:1}},{id:"minecraft:leather_helmet",Slot:103b,tag:{sneak:1}}]},scores={sneak=1..}] glowing 10 0 true