#kill detector

7 messages · Page 1 of 1 (latest)

crisp panther
#

That means there is some syntax error with at least one of the commands.

#

Thing is, I don't really see anything wrong with the controller you posted. Could it be something else?

latent epoch
#

Why don't you use script?

lusty cape
#

Because I didn't know you could use scripts

lusty cape
latent epoch
#
world.events.tick.subscribe(PlayerDeath)
function PlayerDeath() {
    let players = world.getPlayers()
    for (let player of players) {
        let playerHealt = player.getComponent("minecraft:health").current
        let isDeath = player.hasTag("death")
        if (playerHealt == 0 && isDeath == false) {
            player.addTag("death")
            player.tell(`§4HEY§e${player.name} §r§4YOU DIED IN: §5${Math.round(player.location.x)}, ${Math.round(player.location.y)}, ${Math.round(player.location.z)}`)
            player.runCommandAsync(`scoreboard players add @p[r=9] kills 1`)
        } else if (playerHealt > 0) {
            player.removeTag("death")
        }
    }
}
``` try this
#

@lusty cape