PT-BR EN
Channel Icon

Crazy Ozz

Official Channel Website

Command Block

How to Add Effects to Armor in Minecraft

Version 1.21.4 Java Edition

Step 1: Let's get the leather helmet to use as an example, using the /give command

give @a minecraft:leather_helmet[custom_data={NightVisionHelmet:1b},lore=['["",{"text":"Night Vision I","italic":false,"color":"dark_aqua"}]'],item_name='["",{"text":"Night Vision Helmet","italic":false,"color":"aqua"}]',enchantment_glint_override=true]

In this example, the leather helmet has several parameters used to customize it

You can change the tag -> represented by NightVisionHelmet:1b however you want

And also the color and name the item will have, as well as its lore description, etc.

Step 2: Let's create a repeat command block (the purple one) and set it to always active

So the detection never stops happening, and now, let’s place the following command:

execute as @a[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",components:{"minecraft:custom_data":{NightVisionHelmet:1b}}}]}] run effect give @s[nbt={Inventory:[{Slot:103b,id:"minecraft:leather_helmet",components:{"minecraft:custom_data":{NightVisionHelmet:1b}}}]}] minecraft:night_vision 1 0 true

What does this command do? Basically, it detects if any player is wearing the leather helmet

The Slot represents the armor location — in this case, 103b is the helmet, and we'll see the others later

Note that our tag appears twice — if you changed it in the other command, change it here too

After that check, the effect command will be executed if the player is wearing the leather helmet

Other items: Here are a few more commands below — the idea is the same, just with the other armor items

For the custom leather leggings:

give @a minecraft:leather_leggings[custom_data={FastLeggings:1b},lore=['["",{"text":"Speed III","italic":false,"color":"dark_aqua"}]'],item_name='["",{"text":"Speed Leggings","italic":false,"color":"aqua"}]',enchantment_glint_override=true]

execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:leather_leggings",components:{"minecraft:custom_data":{FastLeggings:1b}}}]}] run effect give @s[nbt={Inventory:[{Slot:101b,id:"minecraft:leather_leggings",components:{"minecraft:custom_data":{FastLeggings:1b}}}]}] minecraft:speed 1 2 true

For the custom leather boots:

give @a minecraft:leather_boots[custom_data={JumpBoots:1b},lore=['["",{"text":"Jump III","italic":false,"color":"dark_aqua"}]'],item_name='["",{"text":"Jump Boots","italic":false,"color":"aqua"}]',enchantment_glint_override=true]

execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:leather_boots",components:{"minecraft:custom_data":{JumpBoots:1b}}}]}] run effect give @s[nbt={Inventory:[{Slot:100b,id:"minecraft:leather_boots",components:{"minecraft:custom_data":{JumpBoots:1b}}}]}] minecraft:jump_boost 1 2 true

Your challenge will be to make the chestplate — as you can see, it will use slot 102b

Still have questions? Watch the video below