Repository navigation
Rules System
This page explains how the LederProtections rule system works.
LederProtections uses WorldGuard as the region backend, but it also includes its own internal rule engine to control player actions more precisely inside protections.
The rule system decides whether a player or action is allowed inside a protection.
It checks things such as:
- who is performing the action;
- where the action happens;
- what protection contains the location;
- what role the player has;
- what rule applies to that action;
- whether the action crosses protection boundaries;
- whether the actor has bypass permission.
LederProtections uses WorldGuard regions as the base region system.
However, LederProtections also adds its own logic for:
- roles;
- members;
- co-owners;
- visitors;
- blocked players;
- GUI management;
- economy features;
- upgrades;
- protected interactions;
- anti-exploit checks.
This means WorldGuard handles region storage, while LederProtections handles the protection behavior that players interact with.
Rules are based on the player's role inside a protection.
Common roles:
| Role | Description |
|---|---|
| Owner | Main owner of the protection. |
| Co-owner | Trusted player with elevated access. |
| Member | Allowed player with normal access. |
| Visitor | Player without special access. |
| Blocked player | Player explicitly denied from the protection. |
| Administrator | Staff member with plugin permissions. |
Each role may have different permissions inside the protected area.
LederProtections can protect many common actions.
| Action | Description |
|---|---|
| Block break | Prevents unauthorized players from breaking blocks. |
| Block place | Prevents unauthorized players from placing blocks. |
| Container access | Protects chests and similar containers. |
| Doors and trapdoors | Controls door and trapdoor usage. |
| Buttons and levers | Controls redstone interaction blocks. |
| Item pickup | Controls item pickup behavior in protected areas. |
| PvP | Controls player damage and knockback behavior. |
| Pistons | Prevents piston-based protection bypasses. |
| Hoppers | Prevents item extraction bypasses. |
| Dispensers and droppers | Prevents automated interaction bypasses. |
| Explosions | Protects against TNT and explosion damage. |
| Fire | Protects against unauthorized fire behavior. |
| Fluids | Controls water and lava behavior. |
| Projectiles | Handles projectile damage crossing protection borders. |
When an action happens, LederProtections follows a general process:
- Detect the action.
- Find the affected location.
- Check if the location is inside a protection.
- Determine the actor.
- Determine the actor's role in the protection.
- Check if the actor has bypass permission.
- Check the rule for that action and role.
- Allow or deny the action.
- Send a message if needed.
- Preserve or rollback behavior when needed.
When a player tries to break a block inside a protection:
- LederProtections checks the block location.
- It finds the protection covering that location.
- It checks the player's role.
- It checks whether that role can break blocks.
- If allowed, the block break continues.
- If denied, the block break is cancelled.
Example:
| Player role | Break blocks |
|---|---|
| Owner | Allowed |
| Co-owner | Depends on rules |
| Member | Depends on rules |
| Visitor | Usually denied |
| Blocked player | Denied |
When a player tries to open a chest inside a protection:
- LederProtections checks the chest location.
- It checks the protection owner/member data.
- It checks the player's role.
- It allows or denies the interaction.
Example:
| Player role | Container access |
|---|---|
| Owner | Allowed |
| Co-owner | Usually allowed |
| Member | Usually allowed |
| Visitor | Usually denied |
| Blocked player | Denied |
LederProtections can block PvP damage and related knockback behavior inside protected areas.
If PvP is denied:
- damage is cancelled;
- immediate knockback is prevented;
- repeated denied-message spam is reduced.
This helps prevent players from attacking or pushing others inside protected areas.
LederProtections protects against dispenser-fired projectiles crossing protection borders.
Example behavior:
| Projectile case | Result |
|---|---|
| Dispenser outside shoots player inside a protection | Damage blocked |
| Dispenser inside shoots player outside the protection | Damage blocked |
| Dispenser in one protection shoots player in another protection | Damage blocked |
| Dispenser and target are in the same protection context | Normal behavior |
| Dispenser and target are both outside protections | Normal behavior |
This prevents dispenser arrows from being used as a protection bypass.
Some actions are dangerous because they can cross protection borders.
Examples:
- pistons pushing blocks into a protection;
- sticky pistons pulling blocks out of a protection;
- hoppers extracting items from protected containers;
- dispensers firing projectiles into protected areas;
- fluids flowing into protected regions;
- explosions affecting protected blocks.
LederProtections checks these cases to prevent bypasses.
LederProtections includes checks for automated systems.
| System | Protection goal |
|---|---|
| Pistons | Prevent pushing or pulling across protection borders. |
| Sticky pistons | Prevent block theft or protected block movement. |
| Hoppers | Prevent item extraction from protected inventories. |
| Dispensers | Prevent protected interaction or projectile bypasses. |
| Droppers | Prevent automated transfer bypasses. |
| Explosions | Prevent protected block damage. |
Some administrators may need to bypass protection rules.
Permission:
lederprotections.bypass.rules
This permission should only be given to trusted staff.
Do not give this permission to normal players.
Recommended use:
| User type | Recommended |
|---|---|
| Server owner | Yes |
| Trusted administrator | Maybe |
| Moderator | Usually no |
| Normal player | No |
Administrative tools and rule bypass are different.
| Permission / Tool | Purpose |
|---|---|
/lep admin |
View and manage protections through admin tools. |
lederprotections.admin |
Access plugin administrative commands. |
lederprotections.bypass.rules |
Bypass the protection rule engine. |
A staff member can have admin tools without necessarily bypassing every protection rule.
This separation is recommended for safer server management.
Visitors are players who do not have a special role inside a protection.
Common visitor behavior:
| Action | Typical result |
|---|---|
| Break blocks | Denied |
| Place blocks | Denied |
| Open chests | Denied |
| Use doors | Depends on rules |
| Use buttons/levers | Depends on rules |
| Attack players | Usually denied |
| Pick up items | Depends on rules |
Server owners can configure behavior depending on their preferred gameplay style.
Members are trusted players with normal protection access.
Common member behavior:
| Action | Typical result |
|---|---|
| Break blocks | Depends on rules |
| Place blocks | Depends on rules |
| Open chests | Usually allowed |
| Use doors | Usually allowed |
| Use buttons/levers | Usually allowed |
| Manage members | Usually denied |
| Transfer ownership | Denied |
Members are useful for friends, teammates or base residents.
Co-owners are trusted players with elevated access.
Common co-owner behavior:
| Action | Typical result |
|---|---|
| Break blocks | Usually allowed |
| Place blocks | Usually allowed |
| Open chests | Usually allowed |
| Manage members | Depends on configuration |
| Edit rules | Depends on configuration |
| Transfer ownership | Usually denied or owner-only |
Only trusted players should be promoted to co-owner.
Owners have the highest normal protection authority.
Common owner behavior:
| Action | Typical result |
|---|---|
| Break blocks | Allowed |
| Place blocks | Allowed |
| Open chests | Allowed |
| Manage members | Allowed |
| Manage co-owners | Allowed |
| Upgrade protection | Allowed if permitted |
| Transfer ownership | Allowed if permitted |
| Remove protection | Allowed |
Some actions may still depend on permissions or configuration.
Blocked players are explicitly denied from a protection.
Common blocked-player behavior:
| Action | Typical result |
|---|---|
| Break blocks | Denied |
| Place blocks | Denied |
| Open chests | Denied |
| Use protected interactions | Denied |
| Attack protected players | Denied |
Blocked player behavior is usually stricter than normal visitor behavior.
LederProtections is designed with performance in mind.
The plugin uses indexing and targeted checks so protection lookups can be efficient during common actions.
Recommended practices:
- keep the plugin updated;
- avoid unnecessary bypass permissions;
- test rule changes before applying them to production;
- use
/lep checkafter major configuration changes; - watch the console for warnings after updates.
Recommended tests after configuration changes:
| Test | Expected result |
|---|---|
| Visitor breaks block inside protection | Denied |
| Member opens allowed chest | Allowed |
| Visitor opens protected chest | Denied |
| Co-owner manages members | Depends on configuration |
| Piston pushes block into protection | Blocked |
| Hopper extracts from protected chest | Blocked |
| Dispenser shoots arrow into protection | Damage blocked |
| TNT explodes near protection | Protected blocks remain safe |
| PvP inside protected area | Follows protection rules |
Check that:
- the region exists;
- WorldGuard is loaded;
- the internal rule engine is enabled;
- the player does not have bypass permission;
- the player is not accidentally added as member or co-owner.
Check that:
- the player is actually a member;
- the rule allows that action for members;
- the protection data saved correctly;
- the player is not blocked;
- there are no console errors.
Check that:
- the internal rule engine is enabled;
- the action is inside or crossing a protection;
- no bypass permissions are being used;
- the plugin is updated to the latest version.
Check that:
- the protection rule allows or denies PvP as intended;
- both players are in the expected protection context;
- no bypass permission is present;
- another plugin is not overriding damage behavior.