DriftCombat
Combat tagging the rest of the suite obeys.
A combat plugin for Paper servers. It puts players in combat when they fight, punishes them for logging out during combat, and adds combat timers, item cooldowns, safe zones and arena borders. Most features are add-ons (expansions), so you only install the ones you want.
Features
- Players who hit or are hit by another player are put into combat for a set time.
- Players who log out during combat are killed, and you can run punishment commands.
- Combat timer in the action bar, a boss bar, or a DriftTAB scoreboard through placeholders.
- Safe zones that players in combat can't enter, using WorldGuard regions.
- Combat borders (arenas) that players in combat can't leave, whether walking, pearling, teleporting or riding.
- Items that can't be used during combat, and item cooldowns, both in
items.yml. - Optional sound and title when a player enters or leaves combat.
- Every message in one file,
messages.yml, with MiniMessage tags or&color codes, in the same style as the other DriftSuite plugins. - New settings and messages from updates are added to your files automatically. Your changes are kept.
Requirements
- Java 25
- Paper 26.3
- BlueSlimeCore 2.9.9 or higher (included in the zip)
- Optional: PlaceholderAPI 2.12.3 or higher, for placeholders
- Optional: WorldGuard 7.0.21 or higher with WorldEdit or FastAsyncWorldEdit, for safe zones and combat borders
- Optional: ProtocolLib, for the Force Field glass wall
Installation
- Stop your server.
- Extract
DriftCombat-1.6.0.zip. - Upload
DriftCombat.jarandBlueSlimeCore.jarto/plugins/. - Upload the add-ons you want from
DriftCombat/expansionsto/plugins/DriftCombat/expansions. For the placeholders in this README, includePlaceholderAPI Compatibility.jar. - Start your server and edit the files in
/plugins/DriftCombat/. - Run
/dcombat reloadto apply your changes.
Add-ons whose plugin isn't installed are skipped and listed in one line at startup. You can delete them.
Turning features on and off
The features section, first in config.yml, turns parts of DriftCombat on or off. A feature that is off doesn't register its listener or command. Changes need a restart.
| Switch | Default | What it covers |
|---|---|---|
combat-effects | true | A sound and an optional title when a player enters or leaves combat (settings under combat-effects below). |
logout-punishment | true | Punish players who log out while in combat (punish.yml). |
item-restrictions | true | Blocked items and item cooldowns while in combat (items.yml). |
combat-commands | true | Commands run when a player is put into or taken out of combat (commands.yml). |
combat-timer-command | true | /combattimer, to see how long you're still in combat. |
pvp-toggle | true | /togglepvp, so players can turn their own PvP off. |
forgive-requests | true | /dcombat forgive, to ask your enemy to end the fight. |
expansions | listed for you | Every add-on in the expansions folder. Each one is listed here for you the first time it loads. Set one to false to stop it loading without deleting its jar. |
Each add-on in the expansions folder is listed under features.expansions the first time it loads, switched on. Set one to false to stop it loading without deleting its jar.
Files
plugins/DriftCombat/
config.yml main settings, starting with the features: switches
messages.yml every message, add-on messages included
items.yml items blocked in combat and item cooldowns
punish.yml what happens when someone logs out in combat
commands.yml commands run when players enter or leave combat or are punished
expansions/ the add-on jars, and one settings folder per add-on:
BossBar/config.yml, CheatPrevention/*.yml, CompatWorldGuard/config.yml, ...
data/ everything DriftCombat writes itself; you never need to open it
playerdata/ one file per player (PvP toggle, punishment count, combat NPC items)
logs/ the Logger add-on's log files
backups/ old files DriftCombat replaced (backups/expansions/<add-on>/ for add-ons)
*.version markers that remember which version wrote a file
Every file starts with a boxed header saying what it's for and how to apply changes, and every option has a note
above it with its unit and allowed values. config.yml lists every file and folder.
Default look: the prefix is DRIFTCOMBAT in bold solid orange (#f97316) followed by a dark grey » (no
brackets). Orange is the accent colour (combat title, timers), soft green (#4ade80) means safe or success, soft red
(#f87171) an error, and amber (#fbbf24) a warning such as being put into combat. Help, status and add-on info
use bold orange headers and • bullets, and the help commands are clickable. Every DriftSuite plugin uses the same
layout with its own colour. To hide the prefix, set prefix-enabled: false in messages.yml.
Updates: new options and messages are added to your files with their notes, and everything you changed is kept.
When the notes themselves change, each file is rebuilt once from the new default with your values written back in;
the old file is kept in data/backups/.
Wrong values
A value DriftCombat can't use never stops the plugin. The console says the file, the option, what was wrong and what
is used instead, and /dcombat reload tells you how many there were:
[DriftCombat] config.yml: timer.default-timer "abc" isn't a whole number, using 10
[DriftCombat] expansions/BossBar/config.yml: bar-color "PURPLEISH" isn't one of PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE, using "RED"
Updating from 1.5.0
Replace DriftCombat.jar and the add-on jars and start the server. On the first start DriftCombat moves its own
files into data/, with one console line each, and never overwrites anything:
| Old place | New place |
|---|---|
playerdata/ | data/playerdata/ |
.messages.yml.version | data/messages.yml.version |
messages.old*.yml | data/backups/ |
expansions/Logger/*.log | data/logs/ |
Every file then gets the new notes once (your values stay), and messages you never changed get the new wording.
Commands
The main command is /driftcombat, also /dcombat.
| Command | Permission | What it does |
|---|---|---|
/dcombat help | driftcombat.command.driftcombat.help | List commands |
/dcombat reload | driftcombat.command.driftcombat.reload | Reload every config and message file |
/dcombat status [player] | driftcombat.command.driftcombat.status | Combat time left, enemies, area and item cooldowns |
/dcombat tag <player> [seconds] | driftcombat.command.driftcombat.tag | Put a player into combat |
/dcombat untag <player> | driftcombat.command.driftcombat.untag | Take a player out of combat |
/dcombat toggle bossbar/actionbar | driftcombat.command.driftcombat.toggle | Turn a combat display on or off |
/dcombat forgive request/accept/reject/toggle | driftcombat.command.driftcombat.forgive | Ask an enemy to end combat |
/dcombat about <add-on> | driftcombat.command.driftcombat.about | Information about an add-on |
/dcombat version | driftcombat.command.driftcombat.version | Plugin version |
/combat-timer [player] | driftcombat.command.combat-timer | Time left in combat |
/togglepvp | driftcombat.command.togglepvp | Turn your PvP on or off (Newbie Helper add-on) |
All command permissions are given to OPs by default.
Bypass Permissions
None of these are given to OPs by default.
| Permission | Effect |
|---|---|
driftcombat.bypass | Never put into combat |
driftcombat.bypass.items | Ignore blocked items and item cooldowns |
driftcombat.bypass.border | Can leave combat borders during combat |
driftcombat.bypass.force.field | Doesn't see the Force Field wall |
Placeholders
Needs PlaceholderAPI and the PlaceholderAPI Compatibility add-on.
Combat
| Placeholder | Example | Shows |
|---|---|---|
%driftcombat_time_left% | 12 | Seconds left in combat. Nothing when out of combat |
%driftcombat_time_left_formatted% | 12s, 1m 5s | Time left in combat. Nothing when out of combat |
%driftcombat_time_left_decimal% | 11.45 | Seconds left with decimals |
%driftcombat_in_combat% | Yes / No | Whether the player is in combat |
%driftcombat_in_combat_raw% | true / false | Whether the player is in combat, without colours, for conditions |
%driftcombat_status% | Fighting / Idle | Combat status |
%driftcombat_enemy_count% | 2 | Number of enemies |
%driftcombat_current_enemy_name% | Steve | Name of the latest enemy |
%driftcombat_specific_enemy_<n>_name% | Steve | Name of enemy number n |
%driftcombat_current_enemy_health_rounded% | 14 | The latest enemy's health |
%driftcombat_punishment_count% | 3 | How many times the player was punished |
The text shown when a player isn't in combat is placeholder.time-left-zero in messages.yml. It is empty by
default, so the timer disappears. Set it to something like Safe to show that instead.
Area
| Placeholder | Example | Shows |
|---|---|---|
%driftcombat_zone% | Safe / PvP | Whether the player is in a safe zone or a PvP area |
%driftcombat_zone_raw% | safe / pvp | The same without colors, for conditions in other plugins |
An area is safe when PvP is off for the world, or when a region add-on blocks player combat there. With WorldGuard,
that's a region with player-combat: deny or pvp: deny.
Item Cooldowns
These work for any item in the cooldowns list in items.yml, as soon as it's added. Use the item name in
lowercase, such as ender_pearl.
| Placeholder | Example | Shows |
|---|---|---|
%driftcombat_cooldown_<item>% | 12s | Time left. Nothing when the item is ready |
%driftcombat_cooldown_<item>_raw% | 12 | Seconds left. 0 when the item is ready |
%driftcombat_cooldown_<item>_ready% | Ready / On cooldown | Whether the item can be used |
Items that aren't in the cooldown list show nothing.
Blocked Items and Item Cooldowns
# plugins/DriftCombat/items.yml
blocked-items:
- CHORUS_FRUIT
cooldowns:
ENDER_PEARL: 15
GOLDEN_APPLE: 10
ENCHANTED_GOLDEN_APPLE: 60
WIND_CHARGE: 5
message-type: ACTION_BAR # ACTION_BAR, CHAT, TITLE or NONE
show-cooldown-overlay: true
clear-cooldowns-on-untag: true
- Blocked items can't be used while the player is in combat.
- A cooldown starts when the item is used during combat: thrown, eaten, drunk, shot, swung or placed. Weapons such as swords, axes, maces, tridents and spears start their cooldown when they hit something.
- Trying to use an item that is blocked or on cooldown shows a message with the time left, like "Golden Apple is on cooldown for 7s".
- With
show-cooldown-overlay, the item gets the grey cooldown shading in the hotbar. - Typos in item names are reported in the console on startup and reload.
WorldGuard: Safe Zones and Combat Borders
Install the WorldGuard Compatibility add-on. It adds these region flags:
| Flag | Effect |
|---|---|
player-combat: deny | Players in combat with a player can't enter the region |
mob-combat: deny | Players in combat with a mob can't enter the region |
damage-combat: deny | Players in combat from other damage can't enter the region |
no-tagging: true | Nobody is put into combat inside the region |
retag-player: true | Players in combat who try to enter the region have their timer restarted |
combat-border: allow | Players in combat can't leave the region |
/rg flag spawn player-combat deny
/rg flag arena combat-border allow
Regions with pvp: deny also count as safe zones. Turn this off with use-pvp-flag: false in worldguard.yml.
Combat borders stop players leaving by walking, flying, elytra, ender pearls, chorus fruit, commands like /home
and /spawn, and vehicles. Players who walk into the edge are pushed back. The push strength, and whether
teleports and vehicles are blocked, are set in worldguard.yml. With ProtocolLib and the Force Field add-on,
players also see a glass wall at the edge.
How players are stopped from entering safe zones (push back, cancel, teleport to enemy or kill) is set in
expansions/CompatWorldGuard/config.yml.
Combat Scoreboard
DriftCombat doesn't draw its own sidebar, because DriftTAB owns the scoreboard and two plugins can't share it.
Add a combat scoreboard to DriftTAB's config.yml instead. DriftTAB shows the first scoreboard whose condition
passes, so put it above your normal one:
features:
scoreboard: true
scoreboard:
scoreboards:
combat:
display-condition: "%driftcombat_in_combat_raw%=true"
title: "<red><bold>Combat"
lines:
- ""
- "&7Time left: &f%driftcombat_time_left_formatted%"
- "&7Enemies: &f%driftcombat_enemy_count%"
- "&7Fighting: &f%driftcombat_current_enemy_name%"
- ""
This needs PlaceholderAPI and the PlaceholderAPI Compatibility add-on.
Developer API
See the API README.
Works with other DriftSuite plugins
Every feature lives in exactly one DriftSuite plugin, so no two plugins fight over the same command, chat message or part of the screen.
| Plugin | Handles |
|---|---|
| DriftChat | Chat format, public chat filter, emojis, mentions, announcements, join and leave messages, cross-server chat, private messages (/msg, /reply, /ignore) and private message spy (/spymsg, /socialspy) |
| DriftStaff | Staff mode, vanish, punishments, reports, staff chat, staff teleports (/stp, /stphere), /invsee, /clearchat, /lockchat, /slowchat, command/sign/book spy, filter for private messages and signs, 2FA |
| DriftTAB | Tab list, name tags, sidebar scoreboard, boss bars and other tab list features |
| DriftTags | Tags and the tag menu. Tags are shown through %drifttags_tag% in DriftChat and DriftTAB |
| DriftEconomy | Currencies, /pay, Vault and Treasury |
| DriftCombat | Combat tagging, combat-log punishments, combat timer in the action bar and boss bar, safe zones, item cooldowns |
| DriftLag | Entity clearing, entity and spawner limits, lag tools |
| DriftHomes | Homes, the homes menu, public homes, home invites and /visit |
| DriftEssentials | Spawn, warps, /tpa, /back, /rtp, kits, nicknames, AFK, /motd, player tools (/craft, /enderchest, /hat, /trash) and admin shortcuts (/gmc, /fly, /heal, /speed) |
| DriftShowcase | The rank showcase NPC: try a rank's look and items before buying it |
How they work together:
- DriftStaff marks vanished staff with the standard
vanishedmetadata. DriftTAB leaves them out of the tab list and online counts, DriftChat treats them as offline in/msg,/ignoreand tab completion, DriftEssentials leaves them out of/tpa,/nearand/seen, and they can't be hurt, so DriftCombat never puts them in combat. - DriftStaff mutes and
/lockchatstop a message before DriftChat formats it, and muted players can't use/msg. - DriftChat filters public chat. DriftStaff filters private messages, other commands and signs. Every message is filtered once.
- DriftLag never removes or limits NPCs, including DriftCombat's combat-log NPCs.
- DriftHomes and DriftEssentials ask DriftCombat before every teleport, so
/home,/spawn,/warp,/tpa,/backand/rtpare blocked during combat. Both use the same warmup, cooldown and safe-landing rules. /backin DriftEssentials remembers where/homeand/visittook you from.- DriftChat sends join and leave messages. DriftEssentials only adds the first-join welcome and
/motd. - Staff teleports stay in DriftStaff. DriftEssentials only has the player ones (
/tpa,/spawn,/warp,/back). - DriftEssentials nicknames are the player's display name, which DriftChat's
{displayname}shows, and%driftessentials_nick%works in DriftTAB. - DriftStaff's
/checkmenu has a button that opens the player's DriftHomes homes. - Prices in DriftHomes and DriftEssentials go through Vault, so they use DriftEconomy when
features.vaultis on in its config. - For a combat sidebar, add a DriftTAB scoreboard with
display-condition: "%driftcombat_in_combat_raw%=true". DriftCombat's README has the full example. - DriftShowcase reads DriftEssentials kits straight from its
kits.yml, so a rank in the showcase can show a kit's items. - DriftShowcase shows LuckPerms group prefixes above its NPC and in its ranks menu, and knows which ranks a player already has. It only reads from LuckPerms and never gives a group or permission.
- DriftShowcase asks DriftCombat before every preview, so ranks can't be tried on during combat. Vanished staff and staff in DriftStaff's staff mode can't try them on either.