The improved kill command will allow us to create custom notifications for the death of a player or mob.
The updated command might look something like this:
/kill @r {[Message:{"text":""},Entity:[Name:{"text":""},Type:{"text":""}],Item:[Usage:{"text":""},Name:{"text":""},Lore:{"text":""}]]}
What does each value mean:
Message - cause of death
Entity - killer
Entity.Name - entity name
Entity.Type - entity type
Item - what item was used to kill the player
Item.Usage - to change the words "by using" to something else like "by applying"
Item.Name - item name
Item.Lore - item lore
Separate data about the entity and about the subject are needed so that when hovering over them in the chat, additional information about them is displayed.
And with the data filled in, the command looks like this:
/kill @r {[Message:{"text":"was reduced to dust by "},Entity:[Name:{"text":"Husk King"},Type:{"text":"Husk"}],Item:[Usage:{"text":"by applying "},Name:{"text":"Sand Sword","color":"gold"},Lore:{"text":"Turns the enemy to dust","color":"light_gray"}]]}
As a result, the player dies, and the following message is displayed in the chat:
Player was reduced to dust by Husk King by applying [Sand Sword]
Please sign in to leave a comment.
0 Comments