Barrier
How tagged players are kept out of safe zones, the glass wall they see, and the punishments for hitting it.
The barrier stops a tagged player from escaping a fight by running into a safe zone: a WorldGuard region with PvP off, or a GriefPrevention or uxmClaims claim (see Safe zones). Two modules make it up:
| Module | File | Does |
|---|---|---|
| Barrier | configs/combattag/BarrierSettings.yml | Blocks the way in and draws the wall |
| BarrierPunishments | configs/combattag/BarrierPunishments.yml | Punishes players who keep hitting the wall |
Both need the CombatTag module. A player who is not tagged walks in and out of safe zones freely.
What a tagged player meets
| The player | Happens |
|---|---|
| Walks or jumps into a safe zone | The move is cancelled, the player is pushed back, a sound plays and a short glass wall flashes in front of them |
| Rides a horse, boat or minecart into one | They are thrown off and pushed back |
| Gets into a vehicle standing in one | Refused, with message |
| Teleports into one, by pearl, command or anything else | Refused, with message |
| Comes near the edge of a safe zone | A red glass wall appears along the edge, within radius blocks |
| Hits or right-clicks that glass | Pushed back, with the interaction sound and message. Counts as a touch for the punishments |
| Was already inside a safe zone when tagged and tries to move | Teleported to the nearest spot outside, within 10 blocks |
The glass is fake: only the tagged player sees it, other players see the real blocks, and it
disappears when the tag ends. With blockTypeCheck on, it is drawn only where the real block is air
or another block you can walk through.
border.mode
| Mode | Movement blocked | Glass wall shown |
|---|---|---|
BOTH (default) | Yes | Yes |
INVISIBLE | Yes | No, only the short flash when stopped |
PHYSICAL | No, the server does not check | Yes |
NONE | No | No |
PHYSICAL relies on the player's game client respecting the fake glass. A modified client walks
through it, so use BOTH or INVISIBLE when the barrier must hold.
BarrierSettings.yml
| Key | Default | Meaning |
|---|---|---|
enabled | true | Turns the barrier on or off |
message | "You cannot enter a safe zone while in combat." | Sent when a teleport or vehicle is refused |
priority | LOW | When the plugin handles teleports |
disabledWorlds | empty | Worlds without a barrier |
useBypassPermission | false | Whether bypassPermission is checked |
bypassPermission | uxmpvpcore.bypass.barrier | Players with it may enter safe zones while tagged |
border.mode | BOTH | See above |
border.radius | 3 | How far around the player the glass wall is drawn, in blocks |
border.knockbackStrength | 0.5 | How hard a stopped player is pushed back |
border.visuals.enabled | true | Draw the glass at all. Off, no wall is ever shown and touching it cannot happen |
border.visuals.material | RED_STAINED_GLASS | The block the wall is made of |
border.visuals.blockTypeCheck | true | Draw only where the real block is passable |
border.visuals.dimensions.widthRadius | 2 | Half the width of the wall that flashes when stopped: 2 makes it 5 blocks wide |
border.visuals.dimensions.heightRadius | 1 | Half its height: 1 makes it 3 blocks high |
interaction.cooldownMs | 500 | Touches closer together than this count once |
interaction.message | "You cannot break the barrier." | Sent when the glass is hit |
effects.enabled | true | Ender and smoke particles where the player was stopped |
sounds.denySound | entity.villager.no | When stopped |
sounds.interactionSound | entity.iron_golem.hurt | When the glass is hit |
sounds.knockbackSound | entity.player.hurt | Not played in 2.0.0 |
Each sound has name, volume and pitch. The name is a Minecraft sound key.
border:
mode: BOTH
radius: 4
knockbackStrength: 0.8
visuals:
enabled: true
material: ORANGE_STAINED_GLASS
sounds:
denySound:
name: block.note_block.bass
volume: 1.0
pitch: 0.5
Punishments for touching the glass
File: BarrierPunishments.yml. A touch is a hit or a right-click on the glass wall; walking into the
safe zone does not count. The plugin counts each player's touches, and steps says what happens at
a given count.
| Key | Default | Meaning |
|---|---|---|
enabled | true | Turns the punishments on or off |
resetOnQuit | true | The count starts again when the player leaves |
resetOnTagExpire | true | The count starts again when the tag ends |
steps | 3 and 5 | What happens at which touch |
Each step has:
| Key | Meaning |
|---|---|
punishments | The list of punishments for this step |
message | The text for MESSAGE |
effectDuration | Seconds for BLIND, SLOW and POISON |
damage | Damage for DAMAGE, in half hearts: 1.0 is half a heart |
| Punishment | Does |
|---|---|
MESSAGE | Sends the step's message |
DAMAGE | Deals damage. Never kills: if the hit would leave less than 0.2 health, it deals nothing |
BLIND | Blindness for effectDuration seconds |
SLOW | Slowness II for effectDuration seconds |
POISON | Poison for effectDuration seconds |
REFRESH_TAG | Starts the combat tag again at full duration |
TELEPORT_TO_ENEMY | Teleports the player to their last attacker |
LIGHTNING_STRIKE | A lightning flash on the player, without damage |
UPSIDE_DOWN | Levitation and nausea. Here effectDuration is in ticks, not seconds: 60 is 3 seconds |
Only the exact counts in steps do something; touches in between do nothing. After the highest step
the next touch starts the count again from zero.
The defaults: the 3rd touch blinds for 3 seconds with a warning, the 5th deals half a heart of damage. A harder example:
steps:
2:
punishments: [MESSAGE, SLOW]
message: "<yellow>Stay out of the safe zone."
effectDuration: 5
4:
punishments: [MESSAGE, DAMAGE, REFRESH_TAG]
message: "<red>Last warning."
damage: 4.0
6:
punishments: [MESSAGE, TELEPORT_TO_ENEMY, LIGHTNING_STRIKE]
message: "<dark_red>Back to the fight."
Changes apply with /pvpcore reload BarrierPunishments; the barrier itself reloads with
/pvpcore reload Barrier.
Related: Combat Tag, hooks.yml
Was this page helpful?