Solved Problem with skript detecting items that have durability

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

ryecrispbread

Member
Apr 23, 2024
3
0
1
24
Code:
command uprooter:
    trigger:
        execute console command "/give %player% netherite_hoe{Enchantments:[{id:sharpness,lvl:10}],display:{Name:'{""text"":""Uprooter""}'},Unbreakable:1b}"
#
on damage:  
    attacker has netherite hoe named "Uprooter" in main hand
    victim is not a vex or armor stand
    apply levitation to victim for 3 seconds
    spawn vex at victim

When using the unbreakable netherite hoe given with the /uprooter command, nothing happens when hitting a mob with it, however using a regular netherite hoe named "Uprooter" works, but only for the first hit when it has maximum durability, afterwards failing to work at all. How could I fix this?
 
just check the name of attacker's tool, and make sure to include a color code. Also there's no purpose to using a give command. use
Code:
set {_d} to netherite hoe of sharpness 10 named "&cUprooter"
give player unbreakable {_d}
 
just check the name of attacker's tool, and make sure to include a color code. Also there's no purpose to using a give command. use
Code:
set {_d} to netherite hoe of sharpness 10 named "&cUprooter"
give player unbreakable {_d}
i already did check the name of attacker's tool with the
Code:
attacker has netherite hoe named "Uprooter" in main hand
line, only changed to add the color code to fit with the code you gave me
 
When you check the type of the tool, it's going to check for an unenchanted, full durability, breakable netherite hoe with that name.

If you just check for the name, with a line like
name of attacker's tool contains "&cUprooter"
It should fix.

Or you can use
attacker has unbreakable netherite hoe of sharpness 10 named "&cUprooter" in main hand
but I think my idea is better.
 
When you check the type of the tool, it's going to check for an unenchanted, full durability, breakable netherite hoe with that name.

If you just check for the name, with a line like
name of attacker's tool contains "&cUprooter"
It should fix.

Or you can use
attacker has unbreakable netherite hoe of sharpness 10 named "&cUprooter" in main hand
but I think my idea is better.
oh ok thank you, your idea works [: