#How can I make custom items without "attacker's tool"

1 messages · Page 1 of 1 (latest)

pale aurora
#

I have been making custom items a lot on my server but they rely on using attacker's tool when I would want to use something like event-item instead.

The issue with attacker's tool is if someone shoots a bow and then switch to hold the custom item when the arrow hits then the custom item will trigger as if its the thing that caused the damage. I am seeing this again in the script below which crashed my server because when it triggers the lightning it just infinitely loops because that lightning causes damage too. So whats a different way to do it so I can detect the item itself not just what they are holding. the docs show that you cannot use event-item, why is that?

    attacker's tool is mace
    if name of attacker's tool is "&bLightning":
        send "&ee" to attacker
        loop players in radius 5 of attacker:
            gamemode of loop-player is not spectator
            strike lightning effect at loop-player
            make attacker damage loop-player by damage/2
        set damage to damage/2```
unborn turtle
#

You could use a damage cause condition, checking if the damage was caused by the player

#

With projectiles, you’d want to probably set an nbt or metadata value of the projectile to the damage you want to be done, so when it hits it will pull from the projectiles data rather then the players tool