Skip to content

Setting Up the Shard Shop

Earn shards in zones, multiply them with boosters and spend them in the shard shop.

Shards are the plugin’s own currency. Zones pay them, boosters multiply them, and the shard shop sells items, boosters and command rewards for them. This page walks through the whole loop. You need optimalafkzone.admin to edit and reload.

In config.yml:

Currency:
Display-Name: "Shards"
Symbol: ""
Primary-Color: "&d"
Secondary-Color: "&5"
Decimals: false

{shards} and {price} print the Primary-Color, the Symbol and the number. {currency} prints the Secondary-Color and the Display-Name. Shards have one name for every amount. Whether numbers look like 12,500 or 12.5K is set by Settings.Number-Format.

Each zone pays shards when its Reward-Mode is Shards or Both and its Shards section is enabled:

Settings:
Reward-Mode: "Both"
Shards:
Enabled: true
Amount: 5
Chance: 100.0

Every payout rolls Chance (a percentage). On success the player gets Amount × their multiplier, rounded, never less than 1, with the SHARDS-EARNED message and sound.

Check a balance with /afkzone shards, and adjust one with /afkzoneadmin shards <give|take|set> <player> <amount>.

A player’s multiplier is the highest of two sources. They never stack.

  • Permission boosters - grant optimalafkzone.booster.<n> with your permissions plugin, for example optimalafkzone.booster.1.5 for a rank that earns 50% more. Permanent while the permission is held.
  • Booster items - each file in boosters/ is a right-click item with a multiplier and a duration. Hand them out with /afkzoneadmin booster give <player> <booster> [amount], sell them in the shop, or put the command in a crate.

Only one booster item can be active at a time. While one runs, redeeming another is refused and the item is kept. A permission booster that is already as strong or stronger also blocks redeeming, so an item is never burned for nothing. Booster time runs in real time, offline included.

/afkzoneadmin booster set <player> <multiplier> [duration] sets an active booster directly, without an item, and replaces whatever was active. Full field list: boosters reference.

The shop opened by /shardshop and /afkzone shop is the file named by Shop.Default-Shop (default shops/shards.yml). Every item in it is always for sale, page by page. Add an entry under Items:

Items:
beacon:
Material: BEACON
Price: 2500

Price is in shards. Add Permission: "some.node" to sell an item to some players only.

An item without Actions hands over the item itself. An item with Actions runs them instead, which is how you sell boosters, ranks, keys or perks:

booster_3x:
Material: AMETHYST_CLUSTER
Name: "&d&l3x Shard Booster"
Glow: true
Price: 1500
Actions:
- "afkzoneadmin booster give {player} shard3x 1"

Each shop file has room for as many items as you like. When there are more items than Item-Slots, add [next] and [previous] buttons to the menu, see shops → Menu.

/afkzoneadmin reload
/afkzoneadmin shards give <you> 5000
/shardshop

Clicking an item you cannot afford flashes the shop’s Insufficient-Funds icon in that slot, and one you lack the permission for flashes No-Permission. Otherwise the confirm menu opens (or the purchase goes through directly with Shop.Confirm-Purchase: false).

Full field list: shops reference.