How to use an event if someone is holding a particular item?

  • 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 comminuty!

    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!

Status
Not open for further replies.
Oct 10, 2021
12
0
1
23
I am trying to make a sword that gives you absorbtion if you hold it but I don't know how I tries using on player's held item change, but that only works when you held the sword previously before swapping. Any Ideasa how to do this?
Code:
on player's held item change:
    if player is not holding an iron sword named "<purple>Protector Worlds" with nbt "{Unbreakable:1,AttributeModifiers:[{AttributeName:""generic.attack_damage"",Amount:17,Slot:mainhand,Name:""generic.attack_damage"",UUID:[I;-121912,29295,214724,-58590]}],HideFlags:6}":
        remove absorption from player
    if player is holding an iron sword named "<purple>Protector Worlds" with nbt "{Unbreakable:1,AttributeModifiers:[{AttributeName:""generic.attack_damage"",Amount:17,Slot:mainhand,Name:""generic.attack_damage"",UUID:[I;-121912,29295,214724,-58590]}],HideFlags:6}":
        apply absorption to player for 100000 seconds
 
ya know just thing about stuff carefully

Code:
if player is holding an iron sword named "<purple>Protector Worlds" with nbt "{Unbreakable:1,AttributeModifiers:[{AttributeName:""generic.attack_damage"",Amount:17,Slot:mainhand,Name:""generic.attack_damage"",UUID:[I;-121912,29295,214724,-58590]}],HideFlags:6}":
        apply absorption to player for 100000 seconds
 
ya know just thing about stuff carefully

Code:
if player is holding an iron sword named "<purple>Protector Worlds" with nbt "{Unbreakable:1,AttributeModifiers:[{AttributeName:""generic.attack_damage"",Amount:17,Slot:mainhand,Name:""generic.attack_damage"",UUID:[I;-121912,29295,214724,-58590]}],HideFlags:6}":
        apply absorption to player for 100000 seconds

It gives an error:can't understand this event: 'if player is not holding an iron sword named "<purple>Protector Worlds" with nbt "{Unbreakable:1,AttributeModifiers:[{AttributeName:""generic.attack_damage"",Amount:17,Slot:mainhand,Name:""generic.attack_damage"",UUID:[I;-121912,29295,214724,-58590]}],HideFlags:6}"'
 
Status
Not open for further replies.