![]() |
VOOZH | about |
Damage types are JSON files located in data packs that define different kinds of damage that entities can take. They control which attributes the damage has as well as which death message is used when an entity dies due to that type of damage.
Additionally, the built-in damage type tags control many aspects of how damage is applied by the game.
Custom damage types can be applied only by using the /damage command.
Damage types are stored as JSON files within a data pack, at the path data/<namespace>/damage_type/<name>.json.
default, as shown below.never, always, or when_caused_by_living_non_player. See below for more detail.hurt (default), thorns, drowning, burning, poking, freezing. See below for more detail.default (default), fall_variants, intentional_game_design. See below for more detail.For example, here is JSON for the built-in minecraft:arrow:
{ "exhaustion":0.1, "message_id":"arrow", "scaling":"when_caused_by_living_non_player" }
| Damage type | Sources |
|---|---|
arrow
|
|
bad_respawn_point
|
|
cactus
|
|
campfire
|
|
cramming
|
|
dragon_breath
|
|
drown
|
|
dry_out
|
|
ender_pearl
|
|
explosion
|
|
fall
|
|
falling_anvil
|
|
falling_block
|
|
falling_stalactite
|
|
fireball
|
|
fireworks
|
|
fly_into_wall
|
|
freeze
|
|
generic
|
|
generic_kill
|
|
hot_floor
|
|
in_fire
|
|
in_wall
|
|
indirect_magic
|
|
lava
|
|
lightning_bolt
|
|
mace_smash
|
|
magic
|
|
mob_attack
|
|
mob_attack_no_aggro
|
|
mob_projectile
|
|
on_fire
|
|
out_of_world
|
|
outside_border
|
|
player_attack
|
|
player_explosion
|
|
sonic_boom
|
|
spear
|
|
spit
|
|
stalagmite
|
|
starve
|
|
sting
|
|
sulfur_cube_hot
|
|
sweet_berry_bush
|
|
thorns
|
|
thrown
|
|
trident
|
|
unattributed_fireball
|
|
wind_charge
|
|
wither
|
|
wither_skull
|
|
Damage types control whether damage scales with difficulty.β[more information needed]
Possible values of [String] scaling:
never: Damage is always the same.always: Damage always scales with difficulty.when_caused_by_living_non_player: Damage scales with difficulty if the attacker[note 1] was a living entity[note 2] and was not a player.Damage types control how incoming damage is shown to the player.
Possible values of [String] effects:
hurt (default): The default hurt sound.thorns: Thorns hurt sound.drowning: Drowning sound.burning: A single tick of burning sound.poking: Berry bush poke sound.freezing: Freezing tick sound.Damage types control the death messages displayed when players or pets die.
Possible values of [String] death_message_type:
default (default): Use the standard death message logic.fall_variants: Use the fall damage death messages, e.g. death.fell.assist.item.intentional_game_design: Show the "intentional game design" death message.When standard death message logic is being used, messages are generated as follows, making use of the [String] message_id tag:
death.attack.<message_id>.item with the following insertions available:
death.attack.<message_id>.player with the following insertions available:
death.attack.<message_id> with the following insertions available:
Because of how the default death messages are set up, most vanilla damage types are divided into ones that always have an attacker[note 1] and ones that never have an attacker. Depending on whether there was an attacker, the translation for normal deaths (death.attack.<message_id>) has either one or two available insertions. Translations have no safe way to access an insertion that may or may not be there, so the primary options are:
The death type is planned to always have an attacker.
"death.attack.mob":"%s was slain by %s", "death.attack.mob.item":"%s was slain by %s using %s",
death.attack.<message_id>.player is not provided, since assisted deaths are impossible.The death type is planned to never have an attacker.
"death.attack.drown":"%s drowned", "death.attack.drown.player":"%s drowned whilst trying to escape %s",
death.attack.<message_id>.item is not provided, since item deaths are impossible.The death type may or may not have an attacker.
"death.attack.electricity":"%s was electrocuted", "death.attack.electricity.item":"%s was electrocuted by %s using %s", "death.attack.electricity.player":"%s was electrocuted whilst trying to escape %s",
death.attack.<message_id> avoids using the second insertion, since it may or may not be present.To avoid the awkwardness of the third option there can be two different damage types, one for use with an attacker, and one for use without an attacker:
"death.attack.active_electricity":"%s was electrocuted by %s", "death.attack.active_electricity.item":"%s was electrocuted by %s using %s", "death.attack.passive_electricity":"%s was electrocuted", "death.attack.passive_electricity.player":"%s was electrocuted whilst trying to escape %s",
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.19.4 | 23w06a | Added damage types to data packs. | |||||
| 1.20 | pre1 | Added outside_border, and generic_kill. | |||||
| 1.20.5 | 23w51a | Added spit. | |||||
| 1.21 | 24w18a | Added wind_charge. | |||||
| 24w19b | Added campfire. | ||||||
| 1.21.2 | 24w33a | Added mace_smash and ender_pearl. | |||||
| 1.21.11 | 25w41a | Added a new spear damage type. | |||||
| 26.2 | snap8 | Added sulfur_cube_hot. | |||||