- check_circle Advancements
- check_circle Functions
- check_circle Loot Tables
Published Aug 28th, 2022, 8/28/22 11:34 pm
- 5,602 views, 8 today
- 506 downloads, 0 today
22
Custom Death Messages (for Minecraft 1.19+)
by: Oligo
Description
This data pack allows you to create custom death messages that display when players die. Messages are written as strings in raw JSON format, and multiple messages can be written for a single death event creating a great amount of variety!
Why not use a resource pack (language file)?
Resource packs can be used to change the encoded death messages, however, this method does not allow the creator to use text formatting. Further, only a single message can be specified for a given death event. This data pack also provides more data relevant to the death event which can be used to further customize your messages.
Features
Death messages can be edited in-game
Messages are stored as strings in the cdm:messages storage space, and can be changed using the /data modify command. Death messages can be created for 10 different death events: combat, explosion, fall, fire, lightning, magic, projectile, starvation, suffocation, and void. (Click here for detailed description of death events). Each death event contains two tags: root and player which hold the message(s) to be displayed. Messages in the player tags display when there is a victim and killer in the death event, while messages in the root tag display when there is only a victim.
Below are some examples of how to change death messages.
Entity names can be used in messages using JSON components
Entity names related to the death event are stored in the entity tag of the cdm:data storage namespace. In the entity tag: victim is the player that died, direct_killer is the entity that dealt the damage responsible for death, and killer is the creator of direct_killer (same as direct_killer if killer dealt final damage to victim). These entity names can be incorporated into messages using the NBT JSON component with the interpret tag set to true.
Below is an example of how to incorporate entity names.
Other parameters can be used in messages
The param tag in the cdm:data storage space contains two tags: loc which contains the death location of the victim, and dist which is the distance between the victim and killer at the time of death (in blocks).
Below are some examples of how to incorporate these parameters in messages:
Messages can be randomized
An arbitrary number of death messages can be added to a single death event pool. Each message will be randomly selected when the death event occurs in the world.
Compatibility
This datapack requires doMobLoot to be true and showDeathMessages to be false. These settings can be changed automatically by typing /reload.
To uninstall the datapack in-game, simply type the command:
by: Oligo
Description
This data pack allows you to create custom death messages that display when players die. Messages are written as strings in raw JSON format, and multiple messages can be written for a single death event creating a great amount of variety!
Why not use a resource pack (language file)?
Resource packs can be used to change the encoded death messages, however, this method does not allow the creator to use text formatting. Further, only a single message can be specified for a given death event. This data pack also provides more data relevant to the death event which can be used to further customize your messages.
Features
Death messages can be edited in-game
Messages are stored as strings in the cdm:messages storage space, and can be changed using the /data modify command. Death messages can be created for 10 different death events: combat, explosion, fall, fire, lightning, magic, projectile, starvation, suffocation, and void. (Click here for detailed description of death events). Each death event contains two tags: root and player which hold the message(s) to be displayed. Messages in the player tags display when there is a victim and killer in the death event, while messages in the root tag display when there is only a victim.
Below are some examples of how to change death messages.
Append a new message to the combat.player pool
data modify storage cdm:messages combat.player append value '{"text":"Example"}'
Create a new message pool for fire.root
data modify storage cdm:messages fire.root set value ['{"text":"Example 1"}', '{"text":"Example 2"}']
Remove the first message in the magic.root pool
data remove storage cdm:data magic.root[0]
Entity names can be used in messages using JSON components
Entity names related to the death event are stored in the entity tag of the cdm:data storage namespace. In the entity tag: victim is the player that died, direct_killer is the entity that dealt the damage responsible for death, and killer is the creator of direct_killer (same as direct_killer if killer dealt final damage to victim). These entity names can be incorporated into messages using the NBT JSON component with the interpret tag set to true.
Below is an example of how to incorporate entity names.
Enter the name of the victim in a combat.root message
data modify storage cdm:messages combat.root append value '{"nbt":"entity.victim", "storage":"cdm:data", "interpret":true, "extra":[{"text":" died"}]}'
Other parameters can be used in messages
The param tag in the cdm:data storage space contains two tags: loc which contains the death location of the victim, and dist which is the distance between the victim and killer at the time of death (in blocks).
Below are some examples of how to incorporate these parameters in messages:
Enter the victim's death location in an explosion.root message
data modify storage cdm:messages explosion.root append value '{"text":"Deathly explosion at ", "extra":[{"nbt":"param.loc", "storage":"cdm:data"}]}'
Enter the distance between the victim and killer in a projectile.player message
data modify storage cdm:messages projectile.player append value '{"nbt":"entity.victim", "storage":"cdm:data", "interpret":true, "extra":[{"text":" was shot by "}, {"nbt":"entity.killer", "storage":"cdm:data", "interpret":true}, {"text":" from "}, {"nbt":"param.dist", "storage":"cdm:data"}, {"text":" blocks away"}]}'
Messages can be randomized
An arbitrary number of death messages can be added to a single death event pool. Each message will be randomly selected when the death event occurs in the world.
Compatibility
This datapack requires doMobLoot to be true and showDeathMessages to be false. These settings can be changed automatically by typing /reload.
To uninstall the datapack in-game, simply type the command:
function cdm:uninstall
Compatibility | Minecraft 1.19 |
Tags |
5695552
119
Create an account or sign in to comment.
also it would be cool if there was a /trigger command that would allow you to see all the messages in a certain pool (e.g. /trigger listDeaths set 3 could list all the ones in the fall damage category)