Price sources
The six places a price can come from, the order they are asked in, and how to set a fallback in prices.yml.
WandWorks does not have its own shop. It asks yours. Six sources sit behind one lookup, and nothing outside that lookup knows or cares which shop plugin you run.
The six sources
| Id | Plugin | Sell price | Buy price |
|---|---|---|---|
shopguiplus | ShopGUI+ | yes | yes |
economyshopgui | EconomyShopGUI, free or Premium | yes | yes |
ultimateshop | UltimateShop | yes | yes |
zshop | zShop | yes | yes |
essentials | EssentialsX worth values | yes | never |
file | prices.yml, shipped with the plugin | yes | yes |
Setting the order
prices:
order:
- shopguiplus
- economyshopgui
- ultimateshop
- zshop
- essentials
- fileThe list is walked top to bottom and the first source that has a price wins. Ids whose plugin is not installed are skipped without any fuss, so the shipped list works whichever shop you run.
Keep file last. It is the only source that always answers, so it makes a good backstop and a poor first choice.
Two things to watch:
- An id that is not one of the six gets a console warning naming it and listing the valid ones. It is then ignored.
- If the list ends up with nothing usable in it,
fileis added back on its own. Without that the sell wand would report every item in the game as unpriced.
At startup the console prints what it settled on:
[WandWorks] Price sources in use, in order: ShopGUI+, prices.ymlThat line is the fastest way to check your shop was actually picked up.
No price is not zero
A source with no price for an item says so. It does not say zero. That difference matters in both directions: an unpriced item is left in the chest rather than taken for nothing, and a shop mode builder wand refuses a block rather than handing it over free.
EssentialsX never answers a buy lookup
Worth is a sell value. Handing it back as a buy price would let a shop mode builder wand buy blocks at sell rates, which is a money printer. So essentials answers sell lookups and stays silent on buy lookups, and the chain moves on to the next source.
Only Vault money counts
EconomyShopGUI can price one item in several currencies. WandWorks takes the Vault entry and treats anything else as no price. UltimateShop is asked through its Vault price methods for the same reason. Everything WandWorks pays or charges is Vault money, so a price in another currency would not mean anything.
Prices are never cached
Every lookup goes live to the source. Several of these plugins price per player, through permission multipliers, rank discounts and dynamic pricing that moves as stock moves, so a cached price goes wrong within minutes.
The cost is kept down by asking fewer questions instead:
- A sell wand groups identical items and asks once per item type, not once per slot.
- A builder wand asks once for the whole line, since every block in it is the same.
- Sources are always handed a single item, so what comes back is a unit price to multiply.
- The per wand
cooldownstops a player hammering the lookups.
Prices are per player
Both the sell and the buy lookup are made for the player holding the wand. A price is only correct for the person who asked for it, because the shop plugin may be applying their rank multiplier or their discount. Two players clicking the same chest can be paid different amounts, and that is your shop plugin working as intended.
prices.yml
The file source is a plain list. Leave out sell or buy to mark that side as having no price.
items:
STONE:
sell: 0.5
buy: 2.0
COBBLESTONE:
sell: 0.3
buy: 1.0
DIAMOND:
sell: 45.0
buy: 140.0Material names are the Bukkit ones. An unknown name gets a console warning naming the line and is skipped, so a typo costs you one item rather than the whole file.
This file is the whole shop on a server with no shop plugin at all. Prices from it are still boosted by the wand's boost, still capped by maximum-value, and still refused under minimum-value.
When a shop plugin breaks
Each source is built inside its own guard, and every individual lookup is guarded on top of that. If a shop plugin updates and changes its API, that one source drops out with a clear console line and every other source carries on. The wands keep working.
| Line | What it means |
|---|---|
| X was found but its price API did not answer, so that source is off | The plugin is there but the API handed back nothing usable |
| X was found but its price API could not be used, so that source is off | Building the hook threw. Usually an API change in a new release |
| The X price source threw on a lookup and was skipped | One lookup failed. That item falls through to the next source |