Hi there! I'm making a lightsaber Skript and it has a custom NBT. I'm trying to make it so when you hold the sword and deal damage to an entity it does damage. The error is that it's detecting the unbreakable NBT, and it doesn't think it's the damage item. Here is my code:
All help is appreciated!
Code:
command /lightsabercraft:
trigger:
if player's inventory contains 25 netherite blocks:
send "&bScanning for items..."
wait 2 seconds
send "&aSuccessfully crafted!"
set {saber::%player's uuid%} to stone sword named "&bLightsaber" with lore "&aA weapon from a more civilized age." with custom model data 6
give unbreakable {saber::%player's uuid%} to player
else:
send "&bScanning for items..."
wait 2 seconds
send "&cYou need 25 netherite blocks for this!"
on damage:
if attacker is holding stone sword named "&bLightsaber" with lore "&aA weapon from a more civilized age." with custom model data 6:
set damage to 20
else:
set damage to 1
All help is appreciated!