Stats
Combat Log counts kills, deaths and kill streaks for every player. They show with /combat stats and in placeholders.
Who gets the kill
- A player who dies while in combat gives the kill to the last player who hit them, whatever killed them in the end: fall damage, lava, the void or anything else. If nobody hit them, the last player they fought gets it.
- A player who dies outside combat gives the kill to the player who did the last damage: a hit, an arrow or other projectile, an end crystal, a bed or respawn anchor, TNT, or lava and fire they placed. This also counts in safe zones and disabled worlds.
- A player who logs out in combat gives the kill to the last player who hit them.
- Killing yourself, for example with your own crystal, counts as a death but not as a kill.
- Several players can fight at once. Each death goes to that player’s last attacker.
- NPCs from plugins like Citizens don’t count. Killing one gives no kill, and an NPC never gets a kill.
Deaths and kill streaks
- Every death counts as a death, also deaths without a killer.
- A counted kill adds 1 to the kill streak. Any death sets it back to 0.
- The best kill streak a player ever had is saved too.
- K/D is kills divided by deaths, with two decimals. With 0 deaths it shows the number of kills.
When a player reaches one of the kill streaks under kill-streaks: in config.yml, everyone sees kill-streak from messages.yml.
kill-streaks:
broadcast-at: [5, 10, 15, 20, 25, 50]broadcast-at: [] turns the kill streak messages off.
Anti-farm
Off by default. When on, a player who kills the same player again within minutes doesn’t get the kill, the other player doesn’t get the death and neither kill streak changes.
anti-farm:
enabled: false
minutes: 10Anti-farm is counted on each server on its own and starts over after a restart.
Storage
Stats are saved under storage: in config.yml. This is the default:
storage:
# sqlite, mysql, mariadb, postgresql or mongodb. Use mysql, mariadb, postgresql or mongodb when several servers share stats.
type: sqlite
# Prefix for every table or collection.
table-prefix: "combatlog_"
# Used by mysql, mariadb and postgresql. PostgreSQL usually runs on port 5432.
sql:
host: localhost
port: 3306
database: combatlog
username: root
password: ""
use-ssl: false
pool-size: 4
mongodb:
uri: "mongodb://localhost:27017"
database: combatlog| Setting | Meaning |
|---|---|
type: sqlite | sqlite saves to stats.db in the plugin folder. mysql, mariadb, postgresql or mongodb save to a database server, so several servers can share the same stats. |
table-prefix: "combatlog_" | Put in front of the table or collection name, so stats are saved in combatlog_stats. |
sql: | Host, port, database, username, password, SSL and pool size for mysql, mariadb and postgresql. PostgreSQL usually runs on port 5432. |
mongodb: | The connection URI and database for mongodb. |
- Changing the storage needs a restart. After a reload the console shows
Storage changes need a restart. - Stats are not copied over when you change the storage.
- If the database can’t be reached, the plugin keeps working without stats and the console shows
Could not connect to ... storage, kills and deaths are not saved. - The database connects in the background when the server starts. Until it’s ready, usually a second or two,
/combat statssays stats aren’t available and deaths aren’t counted. - Every database call runs off the main thread.
Commands
| Command | What it does | Permission |
|---|---|---|
/combat stats [player] | Shows kills, deaths, K/D, kill streak and best kill streak. Works for offline players too. | combatlog.use |
/combat resetstats <player> | Sets all stats of a player back to 0. | combatlog.admin |