Combat

Hitting another player puts you both in combat for the time set by combat-time in config.yml, in seconds. It’s combat-time: 20 by default. A player can fight several players at once and still has one timer.

Getting tagged

The attacker and the victim are both tagged when a player damages another player with:

  • melee hits
  • arrows, tridents and any other projectile they shot
  • end crystals, TNT, respawn anchors and beds they set off
  • lava and fire they placed (lava bucket, flint and steel, fire charge)
  • splash and lingering potions, only when the potion actually did damage

Nobody is tagged when:

  • a player damages themselves
  • either player is in a safe zone or a disabled world (hits into or out of a safe zone are cancelled, see Safe zones)
  • either player is in creative or spectator, is vanished, or has combatlog.bypass
  • either player is an NPC from a plugin like Citizens

Timer resets

These are under timer-resets: in config.yml. Each action sets the timer back. full means back to combat-time. A number is the time in seconds, for example ender-pearl: 10.

SettingAction
hit: fullHitting another player or getting hit.
ender-pearl: fullThrowing an ender pearl.
firework-damage: fullA firework that damages a player.
firework-boost: fullUsing a firework to boost an elytra.
  • A reset never makes the timer shorter. If more time is left than the reset gives, nothing changes.
  • Pearls and fireworks only reset a timer that is already running. They never start combat on their own.

How combat ends

  • The timer reaches 0.
  • The player dies.
  • Every player they were fighting has died. Combat ends right away, without waiting for the timer.
  • An admin runs /combat remove <player>.

When combat ends by the timer, because the opponents died, or by /combat remove, blocked potion effects are given back.

Logging out in combat

  • A player who leaves in combat is killed like a normal death. Items and XP drop like on any other death (unless the keepInventory game rule is on), and they see the death screen when they join again. Totems don’t save them.
  • The last player who hit them gets the kill, in the stats and for plugins that reward kills.
  • Every way of leaving counts: quitting, being kicked or banned, timing out and game crashes.
  • Changing server through Velocity counts as leaving, because the player leaves this server.
  • Everyone sees combat-logged from messages.yml in chat. Leave it empty ("") to send nothing. No kill message is sent for this death.
  • When the player joins again and clicks Respawn, they see combat-logged-title from messages.yml in big text on the screen. By default the title is “You died” with “You logged out of combat.” below it. Leave it empty to show nothing.

Server stops and restarts

Stopping the server never kills anyone. The combat time left, who each player was fighting and their saved potion effects are written to plugins/CombatLog/tags.yml when the plugin stops, and each player is put back in combat with the same time when they join again. A player who logged out in combat and hasn’t joined again before the restart still sees combat-logged-title when they join. Players who don’t join again within 7 days are removed from tags.yml at the next start.

What players see and hear

WhereDetails
Action baraction-bar in messages.yml, &7Combat: &#00A6FF{time}s by default. {time} counts down in whole seconds, rounded up. When combat ends it shows 0 and fades out.
Boss barOff by default. Turn it on with enabled: true under bossbar: in config.yml. The bar empties as the timer runs down. Title: bossbar-title in messages.yml.
Chatcombat-entered and combat-left in messages.yml. Both are empty by default, so nothing is sent. combat-left isn’t sent when combat ends because the player died, logged out or the server stopped.
Soundscombat-entered and combat-left have a sound even when the message is empty. See Sounds.
CountdownA tick sound in the last seconds of combat, set under countdown-sound: in config.yml.
yaml
countdown-sound:
  enabled: true
  seconds: 3
  sound: "block.note_block.hat 1.0 1.6"
SettingMeaning
enabled: truePlay the tick sound. false turns it off.
seconds: 3How many of the last seconds tick, one tick each second.
sound: "block.note_block.hat 1.0 1.6"The sound, its volume and pitch. "none" plays nothing.