CombatLogX: preventing combat logging
CombatLogX is the most popular plugin for preventing combat logging on Minecraft servers. Combat logging is when a player disconnects in the middle of a fight to avoid dying. CombatLogX punishes that behavior and blocks escaping from combat.
What CombatLogX is
CombatLogX is a free, modular plugin that solves one of the most common problems on PvP servers: escaping a fight by logging out. When a player is losing, they can simply close the game. They vanish from the server and the attacker loses the victim. That is frustrating for PvP players and ruins the balance of the gameplay.
The plugin introduces a "combat tag" mechanic: after attacking or being attacked, a player is marked as "in combat" for a set amount of time. If they log out in that state, they take a penalty: death, dropping their inventory, losing money or a ban.
CombatLogX is available on SpigotMC and GitHub. The plugin has a modular architecture with dozens of expansions.
How combat tagging works
Combat tagging works in a simple way:
- Activation: a player gets a combat tag when they attack another player, get attacked by a player, or (optionally) get attacked by a mob
- Timer: the combat tag lasts 15 seconds by default. The timer resets with every further attack
- Notification: the player sees the timer on the action bar, boss bar or in chat, so they know how many seconds they have to wait
- Restrictions: while tagged, a player can't log out without consequences, use /home, /tpa or /spawn, or enter a safe zone
- Logout penalty: if the player logs out, they die automatically. Their inventory drops on the ground
- Ending: the tag ends when the timer runs out, when one of the players dies, or (optionally) when they move out of range
Commands
| Command | What it does |
|---|---|
/combatlogx | Shows plugin information |
/combatlogx reload | Reloads the configuration |
/combatlogx toggle | Turns combat tagging on or off |
/combatlogx untag Player | Manually removes the combat tag from a player |
/combatlogx forgive Player | Cancels the combat log penalty |
/ct | Shows how much time is left on your combat tag |
Expansions
CombatLogX has a modular architecture. Expansions are installed as separate .jar files in plugins/CombatLogX/expansions/:
- Action Bar: shows the combat tag timer on the action bar (above the hotbar)
- Boss Bar: shows the timer as a boss bar at the top of the screen
- Scoreboard: shows the timer on the scoreboard (on the right side)
- Citizens NPC: when a player logs out, an NPC appears in their place and can be killed
- WorldGuard: blocks entering regions with the "safe" flag while tagged
- Disabled Commands: blocks teleport commands (/home, /tpa, /spawn) during combat
- Cheat Prevention: blocks flying, opening ender chests and switching game modes
- Rewards: rewards for killing a player who had a combat tag
- Mob Tag: a combat tag triggered by mobs (not only players)
The Citizens NPC expansion is especially popular on PvP servers: the player logs out, but their NPC stays in place and can be killed, dropping their entire inventory.
Configuration
The plugins/CombatLogX/config.yml file:
# Combat timer
combat:
timer: 15 # seconds of combat tag
reset_on_hit: true # reset the timer on every further hit
# Logout penalty
punish:
enabled: true
kill_on_logout: true # kill the player on logout
broadcast: true # announce the combat log in chat
# Restrictions
disable:
flight: true # block flying during combat
teleportation: true # block teleportation
ender_pearls: false # block ender pearls (optional)
elytra: false # block the elytra (optional)
# Messages
messages:
tagged: "&cYou are in combat! Don't log out for {time} seconds."
expired: "&aCombat timer ended. You can log out safely."
combat_log: "&c{player} logged out during combat!" Every expansion has its own config file in plugins/CombatLogX/expansions/.
Tips for admins
- Citizens NPC is a must-have: the NPC expansion is the most effective punishment for combat logging. The player can't escape because their NPC stays on the server
- 15 seconds is a good start: a timer that is too short (5 s) is pointless, and one that is too long (30 s+) frustrates players who just want to log out normally
- Don't block ender pearls on PvP: pearls are part of the combat mechanics. Blocking them annoys good PvP players
- The boss bar is the most readable: of the timer display expansions, the boss bar is the most visible and the hardest to miss
- Safe zone with WorldGuard: on servers with PvP zones, set up the WorldGuard expansion so players can't flee to a safe zone during combat
- Don't enable mob tag on survival: a combat tag from mobs is frustrating on a survival server. A player wants to log out, but a zombie hit them and now they have to wait 15 seconds
Related plugins: WorldGuard (safe zone regions), EssentialsX (teleport commands), LuckPerms (permissions).