SRegionProtector is a flexible region-protection plugin for PowerNukkitX. Players can claim areas, manage members and owners, configure protection flags, and work with regions through commands or a chest/form UI.
Note
This repository is a port of the original Nukkit plugin to PowerNukkitX. Because much of the code originates from the Nukkit version, it is not intended as a reference project for learning the PowerNukkitX API.
- Cuboid region creation with a selection wand or position commands
- Region owners and members
- Configurable protection flags
- Chest and form-based user interfaces
- YAML, SQLite, MySQL, and PostgreSQL storage
- Optional region creation costs and region trading through LlamaEconomy
- Region priorities, borders, teleportation, and data migration
- English, Russian, and Korean translations
- Asynchronous command execution, loading, and automatic saves
- A current PowerNukkitX server
- Java 21
- LlamaEconomy (optional; required for economy features)
- Download the latest JAR from the GitHub releases page.
- Copy the JAR into the server's
pluginsdirectory. - Start the server once to generate the configuration files.
- Stop the server, adjust the files in
plugins/SRegionProtector/, and start it again.
The default configuration uses YAML storage, so no database setup is required for a basic installation.
All subcommands are available through /region or its alias /rg.
- Run
/rg wandto receive the selection wand. - Select two opposite corners of the area. Alternatively, use
/rg pos1and/rg pos2. - Check the selection with
/rg sizeor/rg showborder. - Create the region with
/rg create <name>. - Open its interface with
/rg gui <name>or manage it through commands.
Run /rg help in-game to see every command available to you. Commands can
also be registered individually unless hide-commands is enabled.
| Command | Description |
|---|---|
/rg wand |
Gives the region selection wand |
/rg pos1 [position] |
Sets the first selection point |
/rg pos2 [position] |
Sets the second selection point |
/rg create <region> |
Creates a region from the current selection |
/rg info [region] |
Shows information about a region |
/rg list <owner|member|creator> |
Lists matching regions |
/rg gui [region] |
Opens the configured region UI |
/rg flag <region> <flag> <allow|deny> |
Changes a region flag |
/rg addmember <region> <player> |
Adds a member |
/rg removemember <region> <player> |
Removes a member |
/rg addowner <region> <player> |
Adds an owner |
/rg removeowner <region> <player> |
Removes an owner |
/rg teleport <region> |
Teleports to a region |
/rg select <region> |
Loads an existing region as the selection |
/rg remove <region> |
Deletes a region |
Permissions follow the pattern
sregionprotector.command.<subcommand>. For example, /rg create requires
sregionprotector.command.create. Most player commands are granted by
default; administrative commands and sensitive flags default to operators.
See plugin.yml for the complete permission
tree and defaults.
The plugin creates its files under plugins/SRegionProtector/.
| File or directory | Purpose |
|---|---|
config.yml |
General settings, storage provider, UI, performance, and limits |
region-settings.yml |
Default flag values and region-specific settings |
DB/ |
SQLite, MySQL, and PostgreSQL connection settings |
Lang/ |
Language files |
Regions/ and Flags/ |
Data used by the YAML provider |
Important options in config.yml include:
provider:yaml,sqlite,mysql, orpostgresqllanguage:default,eng,rus, orkorgui-type:chestorformactive-flags: enables individual flag handlers; disabled flags do not enforce protectiondefault-max-region-sizeanddefault-max-region-amount: player limitsregion-creation-priceandprice-per-block: economy-based creation costspriority-system: enables priorities for overlapping regions
Important
Flags are selectively enabled in active-flags. If a flag appears to have
no effect, check that section before reporting a problem.
Set provider in config.yml, then edit the corresponding file in DB/.
# config.yml
provider: mysqlFor MySQL and PostgreSQL, configure address, port, database, username,
and password. SQLite only requires its database file setting. Restart the
server after changing providers.
The administrative migration command can copy existing regions between providers:
/rg migrate <source-provider> <target-provider>
Back up the plugin directory and database before migrating production data.
The project uses Maven and targets Java 21.
git clone https://github.com/PowerNukkitX-Bundle/SRegionProtector.git
cd SRegionProtector
mvn clean packageThe shaded plugin JAR is written to target/SRegionProtector.jar.
PowerNukkitX and LlamaEconomy are provided dependencies and are not bundled
into the artifact.
- Report reproducible bugs through GitHub Issues.
- Existing usage notes are available in the project wiki.
- Pull requests are welcome. Please describe the motivation and test the resulting JAR on PowerNukkitX.
When reporting an issue, include the PowerNukkitX version, Java version, SRegionProtector version, selected storage provider, relevant configuration, and the complete error log.
SRegionProtector is distributed under the GNU General Public License v3.0.