> For the complete documentation index, see [llms.txt](https://wiki.gpplugins.com/playermarketgui/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.gpplugins.com/playermarketgui/playermarketgui/protection-plugins.md).

# Protection plugins

How PlayerMarketGUI handles compatibility with protection plugins

PlayerMarketGUI has integration support with various protection plugins, making sure chest shops can only be created in regions/areas that players are allowed to access.

## WorldGuard

By default, if the plugin detects that WorldGuard is loaded, it adds two custom flags for regions to control whether:

* Players can create chest shops within the region
  * Disabled by default (Enabled by default in the global region)
* Players can buy items from chest shops within the region
  * Enabled by default

## WorldEdit

While this hook doesn't really prevent any events in the plugin, it instead listens to WorldEdit or FastAsyncWorldGuard(FAWE) block change events to see if existing chest shops were replaced with a different block in the world with commands like //set, //replace, ...&#x20;

This is also used by AdvancedRegionMarket and similar plugins that use WorldEdit to clear plots/regions so that chest shops are instantly removed from your world and do not become ghost shops untill the next server restart.

## Lands

If Lands is loaded, the plugin will load two custom Role flags for claims that can be toggled independently:

* A role flag that lets the claim owner toggle the creation of chest shops within their land
* A role flag that toggles buying items from chest shops within the claim

#### Steps to enable

For role flags to show up in GUI's to be toggle able by the land owner, you need to add them to your 'roles.yml' config of lands.

1. Open the `roles.yml` config inside the Lands plugin folder
2. Go to the Lands -> Display section (Should be the first list in the file)
3. Add the `chest_shop_creation` and `chest_shop_purchases` flag

It should end up looking like this:

<div align="left"><figure><img src="https://510971529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMkucDBOmv5LgCnrva2yd%2Fuploads%2F5HA20SYy0aiW4OTbBNxf%2Fimage.png?alt=media&amp;token=f8def194-44a5-4cc9-9627-134d671b2a63" alt=""><figcaption></figcaption></figure></div>

#### Defaults

After that you should set the default behavior of the flags or both flags will default to being disabled for all roles. \
\
Whereas we recommend defaulting the `chest_shop_purchases` flag to all roles and only allowing Owner/Admin roles to create chest shops using the `chest_shop_creation` flag.\
Note that this is just our recommended example, but the defaults can ofcourse be changed to what best fits your server

1. Open the `roles.yml` config inside the Lands plugin folder
2. Go to the Lands -> roles section
3. Expand the section of the role you want to change the default for
4. Add the `chest_shop_purchases` and/or `chest_shop_creation` flag under the 'default' section

Once you configured the new flags within Lands, save the roles config followed by a server restart.\
And if you enabled the fags properly, you should also see the new options inside the 'Action' tab when configuring a role for your /land

## GriefDefender

When installed 2 new flags will be created:

* `pmgui:chest-shop-creation` - Whether the player is allowed to create chest shops from empty chests
  * Claim owners/admins need the `griefdefender.advanced.admin.flag.chest-shop-creation` permission to be able to use the flag using the /cf command
* `pmgui:chest-shop-purchases` - Setting whether the player can purchase items from existing chest shops inside the claim
  * Claim owners/admins need the `griefdefender.advanced.admin.flag.chest-shop-purchases` permission to be able to use the flag using the /cf command
  * This flag defaults to true

Once a claim owner has permission to use the flag, they can toggle it seperately from trust values using `/cf pmgui:chest-shop-creation any true`. \
When not explicitly set, this defaults to the trust levels of a player via /trust or specifically the BUILD and CONTAINER trust levels

## GriefPrevention

When GriefPrevention is installed, the plugin will automatically hook into it.

This will automatically prevent players which aren't able to build inside claims to also create chest/sign shops on existing chests and prevent players from buying items in shops if the player doesn't have any access permissions in the claim.

## Towny

Towny protects Worlds/regions without a plot by default and thus also won't allow players to create chest shops in the wild unless explicitly enabled in config.

```yaml
# If enabled, overrides Towny's protection in Wild regions and allows players to create chest shops
wild-shop-creation: false
```

By default players are only able to create chest shops in Shop plots within a claim, but when this config setting is disabled, players will be able to create chest shops in whatever region of a claim.

```yaml
only-allow-shop-creation-in-shop-plots: true
```

## ChestProtect

ChestProtect allows players to lock a chest while adding players to be able to manage it aswell, by default the plugin will only allow creating chest shops for trusted players of a chest, whereas stranger players will be able to purchase from it

## Special chest plugins

{% hint style="success" %}
NOTE that even though your plugin might not be listed in this list, ALL plugins are supported when having the [`use-create-fallback-integration`](/playermarketgui/playermarketgui/configuration.md#chest-shops) option enabled inside the config.yml which uses a fake block break event to see if the chest is protected by any sort of plugin
{% endhint %}

The following plugins have direct support to prevent players from creating a chest/sign shop on a already existing special chest

* AutoSellChests
* QuickShop Hikari


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.gpplugins.com/playermarketgui/playermarketgui/protection-plugins.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
