Protection

1 Rules explained

You can use regions to protect your area. Every region allows you to setup multiple rules, these rules decide who can or can’t do something. You can also add rules to a kingdom, these rules will apply to all regions claimed by that kingdom.

NB. Most of the time you want to allow or deny an action by a player based on their relation with your kingdom. Therefore it is necessary that a region is claimed by a kingdom.

NB. Don’t forget to disable the protection of WorldGuard with /rg flags add <region> build allow.


2 Rules

2.1 Rule format

This is the format of rules:

<type> <state> <relation> (<target>)

type: This is the rule type (building, teleporting, opening chests...)

state: This can be any of ALLOW or DENY.

relation: This decides who the rule applies to (kingdom members, enemies, allies...)

target: This is an optional argument for some rule types (e.g. block type for the BUILD rule)


2.2 Rule types

  • BUILD: Place and break blocks

  • INTERACT: Interact with blocks (door, button, gate, armor stand...)

  • CONTAINER: Open containers (chest, beacon, barrel...)

  • NEUTRAL_MOBS: Kill or ride on neutral animals

  • HOSTILE_MOBS: Kill monsters

  • PVP: Fight with players

  • DAMAGE_OWNER: Fight with members of this region’s kingdom

  • PICKUP_ITEMS: Pick up items from the ground

  • TELEPORT: Teleport to or from this region

  • FLY: Fly in this region

  • DESTROY: More destructive breaking like TNT cannons

  • COMMAND: Execute (specific) commands

  • ENTRANCE: Enter this region

  • MINING_REGION: Break respawing blocks in this Mining Region.


2.3 Rule state

This allows (ALLOW) or denies (DENY) actions defined by the rule type. In case of an overlap, rules with the ALLOW state will have priority.


2.4 Rule relation

This decides for whom the rule applies. A relation with a higher priority will be checked first (the following list is sorted from low to high).

  • ANY: Everyone

  • NEUTRAL: Neutral kingdoms or players without a kingdom

  • ALLY: Allies

  • ENEMY: Enemies

  • KINGDOM: Kingdom members

  • VISITOR: Visitors (more info)

  • ATTACKER: Enemy team during an event (more info)

  • DEFENDER: Team members during an event (more info)

  • ANARCHY: Members of a kingdom in anarchy (more info)


You can also add more relations that are applicable if the player has the following permission: kingdom.regions.protection.relation.NAME.

protection:
  permission-relations:
  - ROLEPLAY_CHARACTER
  - DONATOR

This allows you to e.g. give donators access to a protected region.


2.5 Target

2.5.1 Blocks

This is applicable to the rule types BUILD,INTERACT and CONTAINER. If you enter the type name of a block, this rule only applies if the action happens on a block of this type.

/k rules add BUILD DENY ENEMY CHEST

1.5.2 Commands

This is applicable to the rule types COMMAND. If you enter a command without the /, this rule only applies if that command is executed.

/k rules add COMMAND DENY ENEMY tp

You can also add commands with subcommands such as k warp. Extra aliases such as tp,  teleport, essentials:tp... etc. will automatically be detected in most cases. However, this only applies to the root command, for subcommands you must add rules for all possible aliases.

1.6 Examples

If nobody is allowed to build except members of the kingdom

BUILD DENY ANY
BUILD ALLOW KINGDOM

If nobody is allowed to place blocks of TNT.

BUILD DENY ANY TNT

If enemies are not allowed to build. Except during an event, if they are attacking, they are allowed to place water.

BUILD DENY ENEMY
BUILD ALLOW ATTACKER WATER

If nobody is allowed to open chests, barrels, … except kingdom members and allies.

CONTAINER DENY ANY
CONTAINER ALLOW ALLY,KINGDOM

If attackers are not allowed to build during an event except water but is may not flow.

BUILD DENY ATTACKER
BUILD ALLOW ATTACKER WATER
BUILD DENY ATTACKER WATER_FLOW

If only members of your kingdom are allowed to execute /k spawn and aliases such as /kdc spawn.

COMMAND DENY ANY k spawn
COMMAND ALLOW KINGDOM k spawn


1.7 Admin bypass

In admin mode you can bypass protection of a specific type if you have the following permission:

kingdom.admin.regions.protection.REGELTYPE


2 Kingdom rule commands

Kingdom rules are applicable to all regions of this kingdom.

2.1 Add rule

You can also use ALL for the <kingdom> argument to add this rule to all existing kingdoms.

/k rules add <rule>

kingdom.rules.add.<type>
kingdom.rules.add.all

/k rules add <kingdom> <rule>

kingdom.rules.add.other

HINT: You can add rules to the template kingdom, these will be copied to newly created kingdoms.


2.2 Copy rules

/k rules copy <from-kingdom> <to-kingdom>

kingdom.rules.copy


2.3 Remove rules

You can also use ALL for the <kingdom> argument to remove this rule from all existing kingdoms.

/k rules remove <rule>

kingdom.rules.remove.<type>
kingdom.rules.remove.all

/k rules remove <kingdom> <rule>

kingdom.rules.remove.other


2.4 Remove all rules

/k rules clear

kingdom.rules.clear

/k rules clear <kingdom>

kingdom.rules.clear.other


2.5 List rules

/k rules list

kingdom.rules.list

/k rules list <kingdom>

kingdom.rules.list.other


3 Region rules

It is recommended to use the commands above to add rules to kingdoms instead of regions.

3.1 Add rules

/k regions rules add <region> <rule>

kingdom.regions.rules.add


3.2 Copy rules

/k regions rules copy <from-region> <to-region>

kingdom.regions.rules.copy


3.3 Remove rules

/k regions rules remove <region> <rule>

kingdom.regions.rules.remove


3.4 Remove all rules

/k regions rules clear <region>

kingdom.regions.rules.clear


3.5 List rules

/k regions rules list <region>

kingdom.regions.rules.list