Trying to make an invisible armor datapack, struggling with if conditions.
The premise is simple really, check if the item the player is holding is a piece of armor, and if it is, make it invisible. This function works for a helmet: execute as @s if items entity @s weapon *[minecraft:equippable] run item modify entity @s weapon {function:"minecraft:set_components", components: {"minecraft:equippable": {slot:'head', model:'air'}}}
The problem here is that I seemingly HAVE to specify the slot of the armor piece, so I have to paths in my mind.
- Do like 4 if statements (but how?) to check for the armor type and then execute the proper command, no clue how to do this. or
- Somehow inherit the slot value, which seems easier.
Would really appreciate some help, I am a total novice at this.