/damage <damage taker> <amount> [type]
/execute as <damage dealer> run damage <damage taker> <amount> [type]
Currently there's no direct, easy and reliable method without side effects to deal a specific amount of damage to an entity. This command will add exactly that with a few advantages:
- The command would deal a specific amount of damage to a mob in half-hearts, no matter what type of mob it is (undead or alive).
- The damage will be dealt as if it was by the <damage dealer>, none of the following will have effect if executed by a command block/function. First of all that means that damage dealer's statistic scores will be updated (damage dealt, kill count). Secondly this would affect mobs accordingly: animals will start running around, neutral mobs will be aggroed, etc.
- [type] will allow to specify the damage type so protective enchantments and other such conditions can take effect, e.g: projectile, explosion, fire, melee, pure (default, will always deal specified amount of damage, no matter the conditions).
There might be other parameters added, like a [true/false] if the command should kill the entity if it's health reaches zero, to imitate a poison effect, but that's inessential.
Please sign in to leave a comment.