#cancellable damage event?

9 messages · Page 1 of 1 (latest)

kindred isle
#

I want to make a script to cancel all damage if the recipient and attacker are on the same team. How can i get the attacker from EntityEvents.hurt? and if possible, the attacker's team?

rigid turretBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

rare osprey
#

/team modify YOURTEAM friendlyFire false

#
EntityEvents.hurt(e => {
    //no chat spam
    if(!e.source.actual) return;
    if(!e.source.actual.isPlayer()) return;
    //no friendly fire
    if(e.source.actual.team == e.entity.team) e.cancel()
    //attacker
    e.server.runCommand(`say ${e.source.actual}`)
    //attacker's team
    e.server.runCommand(`say ${e.source.actual.team}`)
});
kindred isle
#

huge oversight on my part lmao

rare osprey