Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Damage type

From SAS Gaming Wiki
Revision as of 11:05, 21 April 2026 by SyncBot (talk | contribs) (Sync: new page from Minecraft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Exclusive Damage types are Minecraft: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 Template:Cmd command.

JSON format

Damage types are stored as Minecraft:JSON files within a Minecraft:data pack, at the path data/<namespace>/damage_type/<name>.json.

For example, here is JSON for the built-in Template:Cd:<syntaxhighlight lang="json">

{ "exhaustion": 0.1,

	"message_id": "arrow",

"scaling": "when_caused_by_living_non_player" } </syntaxhighlight>

List of damage types

Damage type Sources
Template:Cd
  • Any kind of Minecraft:arrow hitting something
  • A spectral arrow or tipped arrow hitting something
Template:Cd
  • A bed or respawn anchor exploding
Template:Cd
campfire
Template:Cd
  • When too many mobs are in one place
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
  • Any entity taking fall damage
  • Riding an entity that took fall damage
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
  • A firework exploding
Template:Cd
  • Hitting a wall or world border while flying using elytra, i.e. "kinetic energy"
Template:Cd
Template:Cd
  • Bees dying after stinging
  • Simulating the [[Minecraft:Advancement/JSON format#minecraft:player hurt entity|Template:Cd]] trigger when punching an Minecraft:interaction entity
  • Used in a Template:Cd package
  • When reporting an end crystal killed by Template:Cmd to the dragon fight
  • An entity achieving a death that is not assigned to any damage type or is assigned to generic damage type
Template:Cd
Template:Cd
Template:Cd
Template:Cd
  • Ticking damage while stuck in a solid block
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
  • A player hitting a mob
  • A player dealing a sweeping attack
  • Feeding a Minecraft:parrot a Minecraft:cookie
  • A player breaking a non-mob entity
  • When granting the Template:Cd criteria if the actual damage type couldn't be found
Template:Cd
  • Anything in Template:Cd, when it can be determined a player was directly responsible
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
Template:Cd
wind_charge
Template:Cd
  • Ticking damage from a Wither effect
Template:Cd

Scaling

Damage types control whether damage scales with Minecraft:difficulty.Template:Info needed

Possible values of Template:Nbt:

  • Template:Cd: Damage is always the same.
  • Template:Cd: Damage always scales with difficulty.
  • Template:Cd: Damage scales with difficulty if the attacker<ref name="attacker2" group="note">The entity that was responsible for the damage. Also known as the "source entity". For example, if a player is shot by a skeleton, the skeleton is the attacker. If a player is shot by a Minecraft:dispenser, the arrow itself is the attacker. If the player is pricked by a cactus, there is no attacker.</ref> was a living entity<ref name="living2" group="note">This includes armor stands.</ref> and was not a player.

Effects

Damage types control how incoming damage is shown to the player.

Possible values of Template:Nbt:

Death messages

Damage types control the Minecraft:death messages displayed when players or pets die.

Possible values of Template:Nbt:

  • Template:Cd (default): Use the standard death message logic.
  • Template:Cd: Use the fall damage death messages, e.g. death.fell.assist.item.
  • Template:Cd: Show the "intentional game design" death message.

Default message type

When standard death message logic is being used, messages are generated as follows, making use of the Template:Nbt tag:

  • If the killing blow was caused by an attacker<ref name="attacker2" group="note" /> and the attacker was holding a named Minecraft:item in their main hand at the time of death, this is categorized as an item death. A translated message is displayed using the translation key death.attack.<message_id>.item with the following insertions available:
    1. The name of the dying entity.
    2. The name of the attacker.
    3. The name of the item.
  • If the killing blow was not caused by an attacker<ref name="attacker2" group="note" />, but the dying entity had recentlyTemplate:Info needed taken damage that was caused by a living entity<ref name="living2" group="note" />, this is categorized as an assisted death. A translated message is displayed using the translation key death.attack.<message_id>.player with the following insertions available:
    1. The name of the dying entity.
    2. The name of the recent attacker.
  • If neither of the above apply, this is categorized as a normal death. A translated message is displayed using the translation key death.attack.<message_id> with the following insertions available:
    1. The name of the dying entity.
    2. The name of the attacker<ref name="attacker2" group="note" />, if there was one.

Design

Because of how the default death messages are set up, most vanilla damage types are divided into ones that always have an attacker<ref name="attacker2" group="note" /> 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.

  • The translation looks like<syntaxhighlight lang="json">

"death.attack.mob": "%s was slain by %s", "death.attack.mob.item": "%s was slain by %s using %s", </syntaxhighlight>

  • The translation key death.attack.<message_id>.player is not provided, since assisted deaths are impossible.

The death type is planned to never have an attacker.

  • The translation looks like<syntaxhighlight lang="json">

"death.attack.drown": "%s drowned", "death.attack.drown.player": "%s drowned whilst trying to escape %s", </syntaxhighlight>

  • The translation key death.attack.<message_id>.item is not provided, since item deaths are impossible.

The death type may or may not have an attacker.

  • The translation looks like<syntaxhighlight lang="json">

"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", </syntaxhighlight>

  • The translation key death.attack.<message_id> avoids using the second insertion, since it may or may not be present.
  • The translation is a little awkward, because the death message when killed by a player mention them only if they're holding a named weapon.

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:<syntaxhighlight lang="json"> "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", </syntaxhighlight>

History

Template:HistoryTable

External links

Notes

Template:Notelist

References

Template:Reflist

Navigation

Template:Navbox Java Edition technical Minecraft:de:Schadensarten Minecraft:fr:Type de dégâts Minecraft:ja:ダメージの種類 Minecraft:pt:Tipo de dano Minecraft:zh:伤害类型