Combat Restrictions
What tagged players cannot do, teleporting, flying and elytra, commands, items and building, and how to loosen each rule.
Five modules limit what a tagged player can do. Each has its own file in configs/combattag/, works
only while the player is tagged, and does nothing to players who are not.
| Module | File | Default while tagged |
|---|---|---|
| TeleportPrevent | TeleportPrevent.yml | No teleport of any kind, ender pearls and chorus fruit included |
| FlyPrevent | FlyPrevent.yml | No flying, no gliding, a worn elytra is moved to the inventory |
| CommandPrevent | CommandPrevent.yml | Only /mute and /ban work |
| ItemPrevent | ItemPrevent.yml | No picking up, no dropping |
| BuildPrevent | BuildPrevent.yml | Blocks can be broken but drop nothing; no placing |
Each module can be turned off with enabled: false in its file. All of them need the CombatTag
module.
Out of the box a tagged player cannot throw an ender pearl, use any command except /mute and
/ban, or pick up an item. Most servers loosen at least the teleport causes and the command list
before opening.
Teleporting
File: TeleportPrevent.yml.
| Key | Default | Meaning |
|---|---|---|
preventCauses | Every cause | Which kinds of teleport are refused |
maxEnderPearlTeleportDistance | 1000 | Longest ender pearl teleport allowed, in blocks. 0 means no limit |
refreshTag | true | A refused teleport tags the player again for the full duration |
useBypassPermission | true | Whether bypassPermission is checked |
bypassPermission | uxmpvpcore.bypass.teleport-prevent | Players with it may teleport. Ops have it |
priority | NORMAL | When the plugin handles teleports, compared with other plugins |
message | "You cannot teleport while in combat." | Sent when a teleport is refused |
preventCauses lists Paper's teleport causes. The main ones:
| Cause | Teleport |
|---|---|
COMMAND | /tp, and the /spawn, /home or /tpa of many plugins |
PLUGIN | Teleports a plugin makes on its own; some plugins use it for /spawn, /warp or RTP |
ENDER_PEARL | Ender pearls |
CONSUMABLE_EFFECT | Chorus fruit and other food that teleports |
NETHER_PORTAL, END_PORTAL, END_GATEWAY | Portals |
SPECTATE | Teleporting to a player in spectator mode |
EXIT_BED, DISMOUNT | Leaving a bed or a vehicle |
UNKNOWN | Anything else |
Because every cause is in the list, ender pearls are refused entirely and
maxEnderPearlTeleportDistance never comes into play. To allow pearls within a distance, remove
ENDER_PEARL from the list. A pearl that would land in another world, or further than the limit, is
then still refused.
preventCauses:
- COMMAND
- PLUGIN
- NETHER_PORTAL
- END_PORTAL
- END_GATEWAY
- SPECTATE
maxEnderPearlTeleportDistance: 30
refreshTag: true
With refreshTag on, a player who tries /spawn again and again stays tagged until they stop.
Flying and elytra
File: FlyPrevent.yml.
| What happens | When |
|---|---|
| Flying is turned off and the player loses permission to fly | When they are tagged, and when they try to fly while tagged |
| Gliding stops, the elytra moves into the inventory and the player is pushed down | When they are tagged while gliding, and when they try to glide while tagged |
| A newly worn elytra moves into the inventory | When they put one on while tagged |
An elytra moves into the inventory only if there is a free slot. Flight is not given back when the
tag ends: a player who used /fly turns it on again.
| Key | Default | Meaning |
|---|---|---|
priority | HIGHEST | When the plugin handles flying and gliding |
disabledWorlds | empty | Worlds where flying and gliding are allowed in combat |
checkPacketBasedGlideToggle | true | Catches the jump that starts gliding as a packet, before the server sees it. Turn it off if gliding acts strangely |
defaultSettings | The settings for every world | |
perWorldSettings | empty | Settings for one world, replacing defaultSettings there |
In defaultSettings, and in each world of perWorldSettings:
| Key | Default | Meaning |
|---|---|---|
checkToggleEvent | true | React when a tagged player starts flying or gliding |
checkMoveEvent | false | Also check on every move. Catches flying given by other plugins, at some cost |
useBypassPermission | true | Whether bypassPermission is checked |
bypassPermission | uxmpvpcore.bypass.fly | Players with it may fly and glide. Ops have it |
flyMessage, glideMessage | "You cannot fly / glide while in combat." | Sent when stopped |
removeWornElytraMessage | "You cannot wear an elytra while in combat." | Sent when the elytra is moved |
The file also has preventFly, preventGlide and removeWornElytraToInventory. In 2.0.0 they have
no effect: flying and gliding are always stopped and the elytra always moved. To allow either in a
world, add the world to disabledWorlds.
A world in perWorldSettings uses only its own section; keys missing there take the plugin's
defaults, not your defaultSettings.
Commands
File: CommandPrevent.yml.
| Key | Default | Meaning |
|---|---|---|
enabled | true | Turns the module on or off |
type | WHITELIST | WHITELIST: only the listed commands work. BLACKLIST: the listed commands are refused, all others work |
commands | mute, ban | The list |
disabledWorlds | example | Worlds where every command works in combat |
bypassPermission | uxmpvpcore.bypass.commandPrevent | Players with it may use every command. Always checked. Ops have it |
priority | NORMAL | When the plugin handles commands |
message | "You cannot use this command while in combat." | Sent when a command is refused |
Only the first word of the command is compared, in lower case and without the slash. Write each name
without a slash, and list aliases and namespaced forms separately: tpa, essentials:tpa.
A list for a typical survival server, where players can still talk and report:
type: WHITELIST
commands:
- msg
- tell
- r
- reply
- report
- helpop
- battlelog
- bl
Or keep everything open and close only escapes:
type: BLACKLIST
commands:
- spawn
- home
- homes
- warp
- tpa
- tpahere
- rtp
- back
- ec
- enderchest
Picking up and dropping
File: ItemPrevent.yml.
| Key | Default | Meaning |
|---|---|---|
disabledWorlds | empty | Worlds where the module does nothing |
defaultSettings.preventItemPickup | true | Tagged players pick up nothing, no message |
defaultSettings.preventItemDrop | true | Tagged players cannot drop items |
defaultSettings.dropMessage | "You cannot drop items while in combat." | Sent when a drop is refused |
defaultSettings.useBypassPermission | true | Whether bypassPermission is checked |
defaultSettings.bypassPermission | uxmpvpcore.bypass.itemprevent | Players with it may pick up and drop. Ops have it |
perWorldSettings | empty | Settings for one world, replacing defaultSettings there |
eventPrioritySettings.itemPickup, itemDrop | NORMAL | When the plugin handles each |
With pickup off, a tagged killer cannot take the loot until the tag ends 15 seconds later. If you use
drop protection to give the killer the loot, set
preventItemPickup: false.
Building
File: BuildPrevent.yml.
| Key | Default | Meaning |
|---|---|---|
priority | NORMAL | When the plugin handles building |
disabledWorlds | empty | Worlds where tagged players build freely |
defaultSettings | Settings for every world | |
perWorldSettings | empty | Settings for one world, replacing defaultSettings there |
In defaultSettings, and in each world:
| Key | Default | Meaning |
|---|---|---|
preventBreak | true | Limit breaking |
preventPlace | true | Limit placing |
breakMode, placeMode | ALL_BLOCKS | Which blocks the limit covers |
breakBlocks, placeBlocks | empty | The block list for WHITELIST and BLACKLIST |
removeBreakDrops | true | See below |
useBypassPermission | false | Whether bypassPermission is checked |
bypassPermission | uxmpvpcore.bypass.buildprevent | Players with it build freely |
breakMessage, placeMessage | "You cannot break / place blocks while in combat." | Sent when refused |
| Mode | Covers |
|---|---|
ALL_BLOCKS | Every block |
WHITELIST | Every block except those in the list |
BLACKLIST | Only the blocks in the list |
removeBreakDrops changes what "limit breaking" means:
removeBreakDrops | Breaking a covered block while tagged |
|---|---|
true (default) | Works, but the block drops no item and no XP. No message |
false | Is refused, with breakMessage |
Placing a covered block is always refused. Buckets of water and lava are not blocks to this module and are never stopped. For example, to let players place only cobwebs and obsidian while tagged and refuse all breaking:
defaultSettings:
preventBreak: true
preventPlace: true
breakMode: ALL_BLOCKS
placeMode: WHITELIST
placeBlocks:
- COBWEB
- OBSIDIAN
removeBreakDrops: false
Related: Combat Tag, Barrier, Item Cooldowns
Was this page helpful?