Stock & Purchase Limits
Every item carries two independent caps: a global stock and a per-player limit. Both are set per item (in items.yml or when you /dshop additem) and both use -1 to mean unlimited.
Global stock
Section titled βGlobal stockβstock is how many copies are available across the whole server for the current rotation.
- Each purchase decrements it by the amount bought.
- At
0the item is sold out β it stays in the GUI, greyed-out and unclickable, until the next rotation. stock: -1= unlimited; it never decrements and never sells out.- On every rotation the shown itemsβ stock is reset to its configured starting value.
Per-player limit
Section titled βPer-player limitβper-player-limit is how many of that item one player may buy per rotation.
- Counts up by the amount bought, per player.
- At the limit, that player gets the βreached your purchase limitβ message; others are unaffected.
per-player-limit: -1= no cap.- Resets every rotation β a new rotation gives everyone a clean slate.
One-stack purchase cap
Section titled βOne-stack purchase capβA single trip through the buy menu can buy at most:
min( the item's max stack size, stock remaining, your remaining per-rotation limit )So even with unlimited stock, one purchase never exceeds a stack (e.g. 64). Players can simply open the item again to buy more, until the stock or their limit runs out.
Example
Section titled βExampleβitems: diamond_sword: display-name: "<aqua>Rotation Sword" material: DIAMOND_SWORD price: 2500.0 stock: 50 # 50 available this rotation, server-wide per-player-limit: 1 # each player may buy 1 per rotation diamond: display-name: "<aqua>Diamond" material: DIAMOND price: 250.0 stock: -1 # unlimited per-player-limit: -1 # no per-player capPersistence
Section titled βPersistenceβLive stock and per-player counts are written to data.yml on every purchase and every rotation, so they survive restarts. You never edit that file by hand β change the starting values in items.yml (then reload); the new numbers take effect on the next rotation.