# Minecraft Damage Type

> Minecraft Damage Type 伤害类型定义：DAMAGE_TYPE 注册表、data/<namespace>/damage_type/ 数据包路径、tags/<namespace>/tags/damage_type/ 标签、JSON 格式（death_message_type 死亡消息行为、effects 受伤音效、exhaustion 饥饿疲劳、message_id 死亡消息翻译键、scaling 难度缩放）、Death Messages 死亡消息（default 默认：实体来源 检查命名物品 三参数/无实体来源 100刻内被生物伤害 两参数、fall_variants 跌落死亡消息、intentional_game_design 故意游戏设计 链接样式）、Damage Scaling 伤害缩放（always 总是缩放、never 从不缩放、when_caused_by_living_non_player 生物来源时缩放、和平0/简单min{0.5d+1,d}/普通d/困难1.5d）、Hurt Sounds 受伤音效（effects 字段决定玩家受伤音效）、服务器启动加载（/reload 不重新加载）、内置 DAMAGE_TYPE 条目不可移除 否则游戏崩溃）。

- Skill: `zmjjkk123-hub/minecraft-damage-type` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zmjjkk123-hub/minecraft-damage-type`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zmjjkk123-hub/minecraft-damage-type/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ZMJJKK123-hub (https://skillmd.com/u/zmjjkk123-hub)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/zmjjkk123-hub/minecraft-damage-type

---


# Damage Types

This content applies only to Java Edition.

Damage type definition files are the data-driven definitions of damage types in datapacks.

## Definition format

Damage types use the `DAMAGE_TYPE` registry; the datapack path is `damage_type` (definitions in `data/<namespace>/damage_type`, tags in `data/<namespace>/tags/damage_type`).

Definition files use JSON with the following structure:

- JSON file root object
  - `death_message_type` (string, default `default`): death message behavior (see below).
  - `effects` (string, default `hurt`): sound played when a player takes this damage (see below).
  - `exhaustion` (float, required): hunger exhaustion added to players who actually lose health.
  - `message_id` (string, required): death message translation key (see below).
  - `scaling` (string, required): difficulty scaling behavior (see below).

## Definition behavior

Damage type data is loaded only once at server startup; `/reload` does not reload it — a server restart is required. Built-in `DAMAGE_TYPE` entries cannot be removed, or the game crashes.

### Death messages

With `death_message_type: default` (the default):

- With an entity source (e.g. mob attack or its arrow): check whether the mob's main hand holds a named item (with `custom_name`).
  - If the source is not a mob, or the mob holds no named item: `death.attack.<msgId>` with parameters [victim name, direct damage dealer name].
  - Otherwise: `death.attack.<msgId>.item` with a third parameter [item name].
- Without an entity source, but the victim was hurt by a mob within 100 ticks (5 s): `death.attack.<msgId>.player` with [victim name, last attacker name].
- Otherwise: `death.attack.<msgId>` with [victim name].

With `fall_variants`: fall death messages are used, independent of `msgId`.

With `intentional_game_design`: `death.attack.<msgId>.message` with [victim name, `death.attack.<msgId>.link` styled as a link].

### Damage scaling

`scaling` values:

- `always`: damage is always affected by difficulty.
- `never`: damage is never affected by difficulty.
- `when_caused_by_living_non_player`: affected only when the source is a mob.

When affected (base damage d):

- Peaceful: 0.
- Easy: min{0.5d+1, d}.
- Normal: d.
- Hard: 1.5d.

### Hurt sounds

When a player takes damage without post-hit immunity, the sound determined by `effects` plays at the player's position.

