API reference / @jsprismarine/prismarine / entity/DeathMessages
entity/DeathMessages
Interfaces
DeathMessage
Defined in: packages/prismarine/src/entity/DeathMessages.ts:19
What the client is told, and renders itself.
Properties
key
key:
string
Defined in: packages/prismarine/src/entity/DeathMessages.ts:21
The vanilla translation key, %-prefixed as the chat packet expects.
parameters
parameters:
string[]
Defined in: packages/prismarine/src/entity/DeathMessages.ts:23
Fills the key's %1$s, %2$s: the victim first, the killer second where there is one.
Functions
deathMessage()
deathMessage(
victim,source):DeathMessage
Defined in: packages/prismarine/src/entity/DeathMessages.ts:113
The line to announce a death with.
Parameters
victim
Who died.
source
What killed them, and who is answerable for it.
Returns
The key and its parameters.
Example
typescript
deathMessage(steve, DamageSource.entity(alex));
// => { key: '%death.attack.player', parameters: ['Steve', 'Alex'] }