Developer API
Other plugins can change what a sale pays: sell boosters, events, rank perks. Add softdepend: [ShopForge]
to your plugin.yml.
Sell event
Since 1.15.0 ShopForge fires com.ttsstudio.shopforge.api.ShopSellEvent on the main thread right before it pays
a player for items sold to a shop: from the shop menu, /sell hand and /sell all. The items are already counted
when the event fires. With no plugin listening, every sale pays what it always paid.
import com.ttsstudio.shopforge.api.ShopSellEvent;
@EventHandler
public void onSell(ShopSellEvent e) {
if (boosterActive) e.multiply(2); // x2 sell booster
}
| Method | What it gives |
|---|---|
getPlayer() |
The player who sells. |
getShopId() / getItemId() |
The shop and the shop entry being sold. |
getAmount() |
How many items. |
getCurrency() |
Currency of the entry ("" or vault = the server economy). |
getBasePayout() |
What the shop would pay with no listener. |
getPayout() |
The payout so far, after earlier listeners. |
setPayout(double) |
Sets the payout. It never goes below 0. |
multiply(double) |
Multiplies the current payout. |