#Custom death message
8 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
[Quote ➤](#1157915798183096420 message) ```js
const $EntityDamageSource = Java.loadClass(net.minecraft.world.damagesource.EntityDamageSource)
ItemEvents.rightClicked(event => {
let damageSource = new $EntityDamageSource("kubejs_test_damage_source",event.player) // (damage source name, damage source entity)
event.player.attack(damageSource, 10)
})
Lang file for death message `assets/kubejs/lang/en_us.json`
```json
{
"death.attack.kubejs_test_damage_source": "%1$s died from death and it possibly hurt"
}
Use %1$s for the player that died and %2$s for the attacker
I found this but I would do a /kill when the player runs out of hp, so this wouldn't work?
just damage them with the damage source and make it the max 32 bit integer
thats all what /kill does, it damages you 2.147b with the damage source "outofworld"
event.player.attack(damageSource, 2147483647)```
Ah ok thanks a lot, I'll do that