Solved Check if player is holding any armor piece

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Remo

Member
Mar 20, 2024
44
3
8
Hello, is there any way to check if player is holding armor ? for example something like this
Code:
on right click:
    if player's tool is armor:
        send action bar "hello" to player
 
Hey! It doesn't take much effort to just do this.

Code:
on right click:
    if player's tool is a chainmail chestplate or chainmail helmet or chainmail leggings or chainmail boots or leather helmet or leather chestplate or leather leggings or leather boots or golden helmet or golden chestplate or golden leggings or golden boots or diamond helmet or diamond chestplate or diamond leggings or diamond boots or netherite helmet or netherite chestplate or netherite leggings or netherite boots:
        send "You are holding armor!" to player
 
Hey! It doesn't take much effort to just do this.

Code:
on right click:
    if player's tool is a chainmail chestplate or chainmail helmet or chainmail leggings or chainmail boots or leather helmet or leather chestplate or leather leggings or leather boots or golden helmet or golden chestplate or golden leggings or golden boots or diamond helmet or diamond chestplate or diamond leggings or diamond boots or netherite helmet or netherite chestplate or netherite leggings or netherite boots:
        send "You are holding armor!" to player
Thank you !!
 
Hey! It doesn't take much effort to just do this.

Code:
on right click:
    if player's tool is a chainmail chestplate or chainmail helmet or chainmail leggings or chainmail boots or leather helmet or leather chestplate or leather leggings or leather boots or golden helmet or golden chestplate or golden leggings or golden boots or diamond helmet or diamond chestplate or diamond leggings or diamond boots or netherite helmet or netherite chestplate or netherite leggings or netherite boots:
        send "You are holding armor!" to player
Theres an easier way buy just checking if the tool contains armor nbt using skbee

Code:
on right click:
    if nbt compound of player's tool has nbt tag "minecraft:armor":
        send "You are holding a peice of armor!" to player
 
  • Like
Reactions: Doodle
ooh great tysm
Theres an easier way buy just checking if the tool contains armor nbt using skbee

Code:
on right click:
    if nbt compound of player's tool has nbt tag "minecraft:armor":
        send "You are holding a peice of armor!" to player
ooh great tysm