/ Damage

This command is used to deal damage to enemies and players.

Command logic: /damage [entity] [damage]

Damage to a Zombie

With this command we will generate damage to a zombie.

/damage @e[type=zombie] 5

Damage to a Player

We will take 3 and a half hearts from a player (each number is half a heart)

/damage @p 7