Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Tutorial

suerion edited this page Oct 26, 2021 · 49 revisions

Welcome to the WorldGuard Tutorial Here you'll find how you can make use of this feature-rich plugin.

WorldGuard lets you and players guard areas of land against griefers and undesirables, as well as tweak and disable various gameplay features of Minecraft (PocketMine in general).

Command: "/region, /worldguard"
Alias: "/rg, /wg"

Permission and their functionality

(Please change <REGION_NAME> to your regions name without < and >):

Permission for the User Interface

worldguard.ui: Permission to use the GUI with /wg

Permission for creating and modifying an region

worldguard.create: Allows creation of regions
worldguard.modify: Allows changes to a region
worldguard.delete: Allows deletion of a region

Permission for regions:

worldguard.enter.<REGION_NAME>: Allows entering region <REGION_NAME>
worldguard.leave.<REGION_NAME>: Allows leaving region <REGION_NAME>
worldguard.edit.<REGION_NAME>: Allows editing in region <REGION_NAME> (using a hoe on dirt for example is considering editing)

worldguard.block-place.<REGION_NAME> and worldguard.place.<REGION_NAME>: Allows player to places blocks in region <REGION_NAME> (This Permissions are the same, took one of these)
worldguard.block-break.<REGION_NAME> and worldguard.break.<REGION_NAME>: Allows player to break blocks in region <REGION_NAME> (This Permissions are the same, took one of these)

worldguard.eat.<REGION_NAME>: Allows player to bypass the eat flag in region <REGION_NAME>
worldguard.drop.<REGION_NAME>: Allows player to bypass the drop flag in region <REGION_NAME> worldguard.usechest.<REGION_NAME>: Allows use of chests in region <REGION_NAME>
worldguard.usechestender.<REGION_NAME>: Allows use of ender chests in region <REGION_NAME>
worldguard.usetrappedchest.<REGION_NAME>: Allows use of trapped chests in region <REGION_NAME>
worldguard.enchantingtable.<REGION_NAME>: Allows use of enchanting tables in region <REGION_NAME>
worldguard.usedoors.<REGION_NAME>: Allows use of doors in region <REGION_NAME>
worldguard.usegates.<REGION_NAME>: Allows use of gates in region <REGION_NAME>
worldguard.usetrapdoors.<REGION_NAME>: Allows use of trapdoors in region <REGION_NAME>
worldguard.usefurnaces.<REGION_NAME>: Allows use of furnaces in region <REGION_NAME>
worldguard.useanvil.<REGION_NAME>: Allows use of anvils in region <REGION_NAME>
worldguard.usecraftingtable.<REGION_NAME>: Allows use of crafting tables in region <REGION_NAME>
worldguard.usenoteblock.<REGION_NAME>: Allows use of noteblocks in region <REGION_NAME>
worldguard.usecauldron.<REGION_NAME>: Allows use of cauldrons in region <REGION_NAME>
worldguard.usebrewingstand.<REGION_NAME>: Allows use of brewingstands in region <REGION_NAME>
worldguard.usebeacons.<REGION_NAME>: Allows use of beacons in region <REGION_NAME> worldguard.usebutton.<REGION_NAME>: Allows use buttons in region <REGION_NAME> worldguard.usepressureplate.<REGION_NAME>: Allows use pressureplates in region <REGION_NAME>

Permission for bypassing in regions:

worldguard.bypass-cmd.<REGION_NAME>: Allows using any commands in region <REGION_NAME>
worldguard.bypass.gamemode<REGION_NAME>: Allows to bypassing the gamemode in region <REGION_NAME>

Permission for bypassing in regions of the whole world will be implemented in future:

worldguard.build-bypass: Allows building in all WG regions of an whole world.
worldguard.break-bypass: Allows block breaking in all WG regions of an whole world.

Commands for create an region and modify flags in regions:

Creating an region:

Creating a region

Be sure that you are an OP on your server, or the permission worldguard.create. This can be done through permission-management plugins such as PurePerms.

Command: /region create <region-name>

Now you will have to select two points to create the region. The region is specified as the area between the two points (cube/cuboid). Congratulations, you've created your first region! You can create as many as you like!

Creating Global regions

To create a Global region for your current world, you can run the command '/rg create global'. This will create a global region for your world named "global.<world_name>". By default, like usual, the world will have building disabled globally. You can re-enable building just like you do in other regions, by using the command '/region flag set global.<world_name> block-break true' and '/region flag set global.<world_name> block-place true'.

Creating subregions

To create a subregion simply create a region within another and set it's priority flag using /region flags set <region-name> priority <value> where the value is a number. Higher values mean higher priorities and the default value is 0. If 2 regions have the same priority, the first one created will be used.

Creating Extended regions.

You can create extended regions, which will create a region that protects from the bottom of your world, all the way to the top. To create an extended region, run the command '/region create <region_name> extended'. Right-click the two corners which you'd like to protect, and you will now have a region that extends the entire vertical length of your world!

Managing a region:

Now that you've created your region, you will want to customize it. There are many flags you can play with for this. You can get a list of region flags using the command /region flags get <region-name>.

Region-based effects

To give a player effects when they join a region, use /region flags set <region-name> effects <effect-id> <effect-amplifier>. The effect duration is infinity and is gone once the player quits the region. To give player speed 2 and jump 3 on joining a region, you can use...

/region flags set <region-name> effects 1 2,

/region flags set <region-name> effects 8 3

Toggle PvP

You can disable PvP in a region by using the command /region flags set <region-name> pvp false. You can re-enable pvp by using /region flags set <region-name> pvp true.

Toggle Terrain Modification (Block breaking, Block placing, ...etc)

Block breaking/placing and interaction with the environment is by default disabled when you create a new region. You can enable it by using /region flags set <region-name> block-break true and /region flags set <region-name> block-place true If you only want certain people to be able to build, you can use the permissions listed above to bypass the flag.

Blocking specific commands

You can block specific commands in specific regions by using the command /region flags set <region-name> blocked-cmds <command>. Example to block command /give and /op in a region:

/region flags set <region-name> blocked-cmds /give,

/region flags set <region-name> blocked-cmds /op

Allow specific commands

You can allow usage of certain commands in a specific region by using the command /region flags set <region-name> allowed-cmds <command>. Example to allow command /give and /op in a region:

/region flags set <region-name> allowed-cmds /give,

/region flags set <region-name> allowed-cmds /op

This will allow the use of /give and /op only, in <region-name>. No other commands can be used other than these.

Add commands, they would be executing by leaving or entering an region

You could add an command, if a player will leaving, or entering an <region-name>.

For execute an Command at entering an <region-name>. (The added command doesn't need /)
/rg flag set <region-name> console-cmd-on-enter give

For owner's, the consol-cmd work also with players name, when you add %player% it would be execute for the player that enter the region.
/rg flag set <region-name> console-cmd-on-enter give %player%

For execute an Command at leaving an <region-name>. (The added command doesn't need /)
/rg flag set <region-name> console-cmd-on-leave give

For owner's, the consol-cmd work also with players name, when you add %player% it would be execute for the player that enter the region.
/rg flag set <region-name> console-cmd-on-leave give %player%

Enable opening doors, trapdoors, chests, hoppers etc.

To do this, you can enable the "use" flag for the region. When "use" is set to true, players will be able to interact with such blocks.

Toggle item drops

To allow/disallow item dropping in a region, you can set the flag "item-drops" to true or false by using the command /region flags set <region-name> item-drops true.

Toggle eating

To allow/disallow eating in a region, you can set the flag "eat" to true or false by using /rg flags set <region-name> eat true/false.

Toggle hunger

To enable/disable hunger in a region, you can set the flag "hunger" to true or false by using /rg flags set <region-name> hunger true/false.

Toggle flowing

To allow/disallow water/lava flow in a region, you can set the flag "glow" to true or false by using '/rg flags set flow true/false'.

Prevent leaf decay

If you are using various types of leaves for decorating regions of your server you might have noticed that if said leaves are not attached to wood they will eventually decay and despawn. WorldGuard provides a flag specifically for that issue.

To prevent leaf decay in a certain area use /region flags set <region-name> allow-leaves-decay false

Prevent plant growth

If you want to stop plants from growing (i.e freeze crops in their current state, prevent grass growth, etc.) you can use the 'allow-plant-growth' flag like this: /rg flags set <region-name> allow-plant-growth false

Prevent block spreading

If you want to stop blocks like Mycelium or Grass from spreading to other blocks you can use the 'allow-spreading' flag like this: /rg flags set <region-name> allow-spreading false

Prevent burning of blocks

If you want to stop blocks from burning away set the allow-block-burn flag to false.

Disable explosion

To disable explosion in a region, set the flag "explosion" to false. You can set it to true if you want to enable it.

More Flags

  • deny-msg: Remove the "You cannot do in this region." message from a region.
  • notify-enter: Send a message when player enters a region. Usage: /region flags set <region-name> notify-enter Hello, you have entered this region.
  • notify-leave: Send a message when player leaves a region. Usage: /region flags set <region-name> notify-leave Hello, you have left this region.
  • allowed-enter: Allow/disallow players from entering a region. Set this flag to true or false.
  • allowed-leave: Allow/disallow players from leaving a region. Set this flag to true or false.
  • whitelist: Add player to whitelist. Usage: /region flags set <region-name> whitelist Steve
  • fly-mode: Let players fly in the region
    • 0 => Shows vanilla behaviour.
    • 1 => Flight mode enabled.
    • 2 => Flight mode disabled.
    • 3 => Flight mode enabled, but is disabled once the player leaves the region.
  • enderpearl: Allow/disallow use of ender pearls (true/false).
  • send-chat: Allow/disallow players to chat (true/false).
  • receive-chat: Allow/disallow players from receiving chat (true/false).
  • game-mode: Set a region's game-mode.
    • false => Disables the flag, does nothing.
    • 0 => Survival mode
    • 1 => Creative mode
    • 2 => Adventure mode
    • 3 => Spectator mode
  • sleep: Allow or block players from entering beds (true/false).

Reset a flag of a region to default value.

/region flags reset <region-name> <flag>

Customized access to regions

Want to create a VIP store that only vips can access? You can do just that by combining the flag 'allowed-enter' and the permission worldguard.enter.<REGION_NAME> like this:

Let's assume that our region is called "vip_shop", in that case we would do the following to only allow VIPs to enter: /rg flags set vip_shop allowed-enter false and then add the 'worldguard.enter.vip_shop' permission to the VIP group or to the user that you wish to access the shop.

Similarily you could prevent a certain group from leaving a region using the 'allowed-leave' and the permission worldguard.leave.<REGION_NAME>.