Skip to content

Setting Up the Shard Shop

Earn shards in zones, multiply them with boosters and spend them in the rotating 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:

Shards:
Enabled: true
Name-Singular: "Shard"
Name-Plural: "Shards"

{currency} shows the singular name for an amount of exactly 1 and the plural otherwise. How amounts look (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). Add an entry under Items:

Items:
beacon:
Material: BEACON
Price: 2500
Weight: 2.0
Limit: 1
  • Price is in shards.
  • Weight is the chance the item is picked into a rotation, relative to the other items.
  • Limit is how many times one player may buy it per rotation. 0 is unlimited.

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
Weight: 2.0
Limit: 1
Actions:
- "afkzoneadmin booster give {player} shard3x 1"
Settings:
Rotation:
Enabled: true
Interval: 86400 # rotate every 24 hours
Slots: 7 # how many items are stocked each rotation
Announce: true # broadcast SHOP-ROTATED

Each rotation draws Slots different items from the pool by Weight and resets everyone’s purchase counts. The rotation and its countdown are saved, so a restart does not reroll the shop.

With Rotation.Enabled: false every item is always stocked and Limit becomes a lifetime limit, because purchase counts only reset on a rotation.

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

Clicking an item you cannot afford, or one you hit the limit on, flashes the shop’s Insufficient-Funds or Limit-Reached icon in that slot. Otherwise the confirm menu opens (or the purchase goes through directly with Shop.Confirm-Purchase: false).

Full field list: shops reference.