Repository navigation
Shop and Economy
This page explains how shop and economy features work in LederProtections.
LederProtections can run without economy features, but if you want players to buy protection stones, pay for upgrades or pay teleport costs, you need Vault and a compatible economy plugin.
Economy features are optional.
| Feature | Requires Vault | Description |
|---|---|---|
| Protection shop | Yes | Allows players to buy protection stones. |
| Protection upgrades | Yes, if upgrades have a cost | Allows players to pay for larger protections. |
| Teleport costs | Yes, if teleport cost is enabled | Charges players when teleporting to protections. |
If Vault is not installed, non-economy protection features can still work.
For economy features, you need:
- Vault;
- a compatible economy plugin.
Vault is only a bridge.
Vault does not create money by itself.
Example setup:
plugins/
├─ WorldEdit.jar
├─ WorldGuard.jar
├─ Vault.jar
├─ EconomyPlugin.jar
└─ LederProtections.jar
The economy plugin can be any Vault-compatible economy plugin supported by your server.
If Vault is not installed:
| Feature | Behavior |
|---|---|
| Protection creation | Can still work. |
| Protection GUI | Can still work. |
| Role management | Can still work. |
| Rule system | Can still work. |
| Protection shop | Economy purchases will not work. |
| Paid upgrades | Economy costs will not work. |
| Teleport costs | Economy costs will not work. |
If you do not want economy features, you can leave Vault uninstalled and disable economy-related options.
The protection shop allows players to buy configured protection stones from a GUI.
Common command:
/lep shop
Depending on configuration, the shop may also be accessible through the protection GUI.
To use the shop with prices:
| Requirement | Needed |
|---|---|
| Vault | Yes |
| Economy plugin | Yes |
| Shop enabled in config | Yes |
| Stone enabled for shop | Yes |
| Player permission | Usually yes |
| Inventory space | Yes |
If the player's inventory is full, the purchase should be blocked safely.
LederProtections includes safety checks for shop purchases.
The plugin should prevent cases such as:
- charging money without giving the stone;
- giving a stone when the player has no inventory space;
- dropping purchased protection stones on the ground because the inventory is full;
- reporting success when the purchase failed.
Recommended test:
- Fill your inventory.
- Try to buy a protection stone.
- Confirm the purchase is blocked.
- Confirm no money is taken.
- Confirm no item is dropped on the ground.
Protection stone prices are usually configured in:
plugins/LederProtections/stones.yml
Example structure:
stones:
x16:
radius: 16
price: 5000.0
shop:
enabled: trueThe exact structure may depend on your generated stones.yml.
Example balanced survival pricing:
| Stone | Radius | Example price |
|---|---|---|
| x4 | 4 | 500 |
| x8 | 8 | 1500 |
| x16 | 16 | 5000 |
| x32 | 32 | 12000 |
| x64 | 64 | 30000 |
These are only examples.
Server owners should adjust prices based on their economy.
Protection upgrades can use economy costs.
Example upgrade path:
x4 → x8 → x16 → x32 → x64
When a player upgrades a protection, LederProtections can charge a cost before applying the upgrade.
A common upgrade model is to charge the difference between the current stone value and the next stone value.
Example:
| Current stone | Current value | Next stone | Next value | Upgrade cost |
|---|---|---|---|---|
| x16 | 5000 | x32 | 12000 | 7000 |
| x32 | 12000 | x64 | 30000 | 18000 |
This prevents players from paying the full price again when upgrading.
Before charging or applying an upgrade, LederProtections should verify:
- the protection exists;
- the player owns or can upgrade the protection;
- the next stone type exists;
- the new area does not overlap another protection;
- the player has enough money;
- the economy transaction succeeds;
- the protection data can be saved.
Recommended test:
- Create a protection.
- Try upgrading it normally.
- Try upgrading without enough money.
- Try upgrading when the larger area would overlap another protection.
- Confirm money is only taken when the upgrade succeeds.
LederProtections can optionally charge players when they teleport to a protection.
Teleport behavior may include:
- warmup time;
- cancellation on movement;
- cooldown;
- optional cost.
Example:
teleport:
enabled: true
warmup-seconds: 3
cancel-on-move: true
cost: 100.0The exact configuration structure may depend on your generated config.yml.
Teleport cost should be charged only when the teleport succeeds.
Recommended test:
- Start a teleport.
- Move during warmup.
- Confirm the teleport is cancelled.
- Confirm money is not taken.
- Try teleporting again without moving.
- Confirm money is charged only when the teleport completes.
LederProtections should avoid unsafe economy behavior.
Important safety goals:
| Situation | Expected behavior |
|---|---|
| Purchase succeeds | Money is taken and stone is given. |
| Inventory is full | Purchase is blocked and money is not taken. |
| Upgrade succeeds | Money is taken and protection is upgraded. |
| Upgrade fails | Money is not taken. |
| Teleport succeeds | Cost is charged if configured. |
| Teleport is cancelled | Cost is not charged. |
| Save fails | Command or GUI should not report success. |
Shop and economy features may require permissions.
Common player permissions:
lederprotections.shop
lederprotections.upgrade
lederprotections.sethome
Stone usage permissions may also apply:
lederprotections.stone.4
lederprotections.stone.8
lederprotections.stone.16
lederprotections.stone.32
lederprotections.stone.64
See the permissions page for more details:
Permissions
For a small survival server:
| Stone | Recommended access | Example price |
|---|---|---|
| x4 | Default players | 500 |
| x8 | Default players | 1500 |
| x16 | Default players | 5000 |
| x32 | VIP or advanced players | 12000 |
| x64 | Premium or late-game players | 30000 |
This setup gives new players basic protection access while keeping larger protections valuable.
Recommended practices:
- Keep small protection stones affordable.
- Make larger protections more expensive.
- Use permissions to limit larger protection sizes.
- Test purchases with a full inventory.
- Test purchases without enough money.
- Test each stone in the shop.
- Keep economy values balanced with your server progression.
Recommended practices:
- Use clear upgrade paths.
- Avoid skipping too many sizes unless intended.
- Charge the difference between protection values.
- Test overlap checks before allowing upgrades.
- Test upgrades with and without enough money.
- Make sure the next stone exists in
stones.yml.
Recommended practices:
- Keep teleport costs reasonable.
- Use warmup to avoid abuse.
- Enable movement cancellation.
- Charge only after successful teleport.
- Test teleport cost with and without Vault.
- Avoid high teleport costs on casual servers.
Check that:
- the shop is enabled;
- the player has permission;
- the command is correct;
- there are no console errors.
Check that:
- Vault is installed;
- an economy plugin is installed;
- the economy plugin is compatible with Vault;
- the stone has a price;
- the stone is enabled in the shop;
- the player has enough money;
- the player has inventory space.
This should not happen.
Check:
- console errors;
- inventory space;
- economy plugin behavior;
- whether the server is using the latest LederProtections version.
Report the issue with reproduction steps if it happens.
Check that:
- upgrade paths are configured;
- the next stone exists;
- Vault is installed if cost is required;
- the player has enough money;
- the larger area does not overlap another protection;
- the player has permission.
Check that:
- teleport is enabled;
- teleport cost is enabled;
- Vault is installed;
- an economy plugin is installed;
- the player has enough money;
- the teleport is not cancelled by movement.