wrenchAPI

TaleShop provides a public API for other plugins to integrate with.

Getting the API

TaleShopProvider api = TaleShopAPI.get();
if (api == null) {
    // TaleShop is not loaded
    return;
}

Sub-APIs

The main TaleShopProvider gives access to four sub-APIs:

API
Description

ShopCatalog

Query and manage categories and items

ShopTransaction

Execute buy/sell operations

AuctionHouse

Create, buy, cancel listings and query mailbox

EconomyAccess

Read-only balance and currency formatting

Shop Catalog

Query and modify the shop programmatically.

ShopCatalog catalog = api.getShopCatalog();

// Get all categories
List<ShopCategory> categories = catalog.getCategories();

// Get items in a category
List<ShopItem> items = catalog.getItems("tools");

// Get a specific item
ShopItem item = catalog.getItem("tools", "Tool_Pickaxe_Iron");

Shop Transactions

Execute buy/sell operations on behalf of players.

Auction House

Auction operations are async and return CompletableFuture.

Economy Access

Read-only access to the active economy provider.

Events

TaleShop fires events that other plugins can listen to. Cancellable events can be cancelled to prevent the action.

ShopBuyEvent (Cancellable)

Fired before a player buys an item from the shop.

ShopSellEvent (Cancellable)

Fired before a player sells an item to the shop.

AuctionCreateEvent (Cancellable)

Fired before a player creates an auction listing.

AuctionBuyEvent (Cancellable)

Fired before a player buys an auction listing.

AuctionCancelEvent (Cancellable)

Fired before a player cancels their auction listing.

AuctionExpireEvent

Fired when an auction listing expires. Not cancellable.

GitHub

API source and documentation: github.com/catzalli/TaleShoparrow-up-right