A Spigot plugin that clears a player's inventory when entering or exiting specific WorldGuard regions. This is mainly used to prevent items from moving between creative and survival areas.
Go to file
EpicKnarvik97 cd83c0404b Fixes #5 and implements #4
Only clears items when exiting a clear region
Tracks when a player enters one or more clear regions, through a custom event
Tracks when a player leaves one or more clear regions, through a custom event
Uses the tracker's region info to check if a player is in a clear region where possible
Excludes boats with player passengers from the vehicle move event, and requires that vehicles are in the clear region, not outside it
Tracks player clear regions when a player joins or changes world
Reduces a lot of code clutter and redundancy in WorldGuardListener
2024-01-11 23:50:13 +01:00
src/main Fixes #5 and implements #4 2024-01-11 23:50:13 +01:00
.gitignore Initial commit 2023-12-16 21:46:06 +01:00
pom.xml Adds a bunch of event cancellations 2024-01-09 23:47:53 +01:00
README.md Adds some more listeners 2024-01-10 02:07:08 +01:00

Clear on WorldGuard

This plugin will clear a player's items when they enter or leave, or teleport to or from one of the configured regions. This is mainly useful if players are able to temporarily go in creative mode in specific WorldGuard regions. A lot of additional things are blocked within clear regions in order to prevent creative mode abuse, such as: projectiles, XP bottle usage, spawn egg usage, changing the mob in a spawner, dropping items, picking up items, breaking, placing or interacting with blocks across clear region borders, block drops, mob drops, pistons pushing or pulling across clear region borders, dispenser dispensers, droppers, armor dispensing, blocks burning, blocks igniting (except flint and steel), creepers exploding, TNT priming and keeping any inventory items if dying within a clear area. This list might not be exhaustive.

Dependencies

  • WorldGuard

Configuration

Add the identifier (name or UUID) of the world you want to specify a region for as a sub-key of clearRegions. Make sure your world identifier is a string list "worldName: []", and add any regions you want to enable inventory clearing for to the list of the world the region belongs to.

Example config:

clearRegions:
  world:
    - "creative_building"
    - "clear"

or

clearRegions:
  world: [ "creative_building", "clear" ]