Damage Command Generator — /damage with Damage Types (Java Edition)
Run these from an operator’s chat, a command block, or the server console. Rotate, Swing and Display Entity use newer command/entity features — check they’re available on your Minecraft version.
How to Use the Damage Command Generator
- Enter a target selector, such as
@e[type=minecraft:zombie,limit=1], or a player name. - Set the damage amount – this is raw damage points before the target’s armor and resistance are applied.
- Pick a damage type from the dropdown, such as
minecraft:magicorminecraft:fire. The type controls which resistances, immunities, and death messages apply. - Optionally enter a “by” entity – another entity selector credited as the attacker, which affects death messages and things like totem/knockback direction.
- Copy the generated
/damagecommand into a command block, the console, or an operator’s chat.
Command Syntax Reference
/damage <target> <amount> [type] [by <entity>] [from <position>]
/damage was added in Java Edition 1.19.4 as a scriptable way to deal damage that still runs through the normal combat pipeline – unlike /kill, it respects armor, enchantment protection, resistance effects, invulnerability frames, and damage-type-specific immunities (a Wither skeleton, for instance, is immune to minecraft:wither damage). The damage type isn’t cosmetic – it changes which protection enchantments reduce the hit, whether it can be blocked with a shield, and what death message displays if it’s lethal.
The optional by entity attributes the damage to an attacker for death-message and mob-targeting purposes (a zombie “killed by” a named entity, or triggering a wolf/iron golem’s aggro toward that attacker) without that entity actually needing to be in melee range. There’s also an optional from position argument (not exposed in this generator) that sets the damage’s source location, which affects things like explosion knockback direction.
Common damage type IDs include minecraft:generic (a plain, unclassified hit), minecraft:magic (bypasses armor the way potions of Harming do), minecraft:in_fire / minecraft:on_fire (fire and burning), minecraft:player_attack and minecraft:mob_attack (melee credited to a player or mob respectively), minecraft:fall, minecraft:drown, and minecraft:starve – the full set covers every vanilla damage source, including newer ones like minecraft:mace_smash, minecraft:wind_charge, and minecraft:spear.
Frequently Asked Questions
How is /damage different from /kill?
/kill always removes the target instantly regardless of armor, resistance, or protective effects – it’s essentially unconditional. /damage deals a specific, adjustable amount through the normal combat system, so armor, Protection enchantments, Resistance, shields, and damage-type immunities can all reduce it or block it outright, and a low amount simply won’t be lethal.
Does /damage respect armor and enchantments?
Yes, that’s the main reason it exists – unlike instantly setting health or using /kill, /damage runs through the same reduction math as a real hit, so Protection, Blast Protection, Resistance potions, and armor values all apply exactly as they would to organic combat damage of that type.
Can a damage type make an entity immune to the hit entirely?
Yes. Some entities have built-in immunities to specific damage types – a Wither skeleton takes no damage from minecraft:wither, and most mobs (and players in Creative mode) are immune to minecraft:starve or fall damage under certain conditions. Picking a type the target is immune to results in a valid command that simply deals zero effective damage.
What does the “by” entity actually change?
It attributes the hit to an attacker for death messages (“Steve was slain by Zombie”) and for AI purposes like a wolf or iron golem targeting that attacker afterward, and it can affect knockback direction – but it does not require that entity to be within any particular range of the target.
Related Tools
- Kill Command Generator – remove an entity unconditionally instead of dealing adjustable, armor-respecting damage.
- Effect Command Generator – apply damage-over-time or protective status effects rather than a single hit.
- Attribute Command Generator – change a target’s max health or armor attribute instead of hitting it directly.