#kill detector
7 messages · Page 1 of 1 (latest)
Thing is, I don't really see anything wrong with the controller you posted. Could it be something else?
Why don't you use script?
Because I didn't know you could use scripts
On death worked in 1.19.31 but now on 1.19.40 it doesn't work I think it is something outdated that I don't understand
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