Skip to content

Developer API

Cupjok edited this page Sep 13, 2026 · 2 revisions

Developer API

Other plugins can use me.sat7.dynamicshop.DynaShopAPI (add softdepend: [DynamicShop] to your plugin.yml).

What it offers

  • Open GUIs: a shop, the start page, quick sell, item/shop settings.
  • Shops: list shop names (getShops()), check a name (validateShopName), the currency of a shop, whether a shop is a Jobs points shop.
  • Prices and stock for an item in a shop: getBuyPrice, getSellPrice, getStock, getMedian, and the tax rate.
  • Find the best shop: FindTheBestShopToSell, FindTheBestShopToBuy.
  • Quick sell for a player: QuickSell(player, itemStack, …). The same rules as /sell apply: only items a shop buys, and never for a payout of 0.

Use the API instead of reading or writing shop YAML files. Everything else is internal and can change.

Events

me.sat7.dynamicshop.events.ShopBuySellEvent is called after every buy and sell. It carries the shop, item, player, old/new buy and sell price, old/new stock and the median.

Building from source

mvn clean package        target/DynamicShop-<version>.jar
mvn test
  • Needs JDK 25+ to build, because the bundled MultiCurrency API is Java 25 bytecode. The jar it produces is Java 21 and is compiled against the Minecraft 1.21 API.
  • mvn -Pcompat-26 compile compiles against the newest API, to catch removed methods.
  • tools/api-kind-check.py checks the built jar for API calls that break between versions.
  • tools/compat-matrix/ starts real test servers for many versions (with an optional GUI bot). See its run-matrix.sh.

Repository: https://github.com/Cupjok/DynamicShop3

Clone this wiki locally