Chest-GUI shop with pagination

Shop ext

Shop opens a paginated chest GUI where players can buy items using a Bank.

from bridge.extensions import Shop

Constructor

Shop(name, bank)

Methods

add_item(item, price)

Add an item to the shop.

open(player, page=0)

Open the shop GUI for a player.

close(player)

Close the GUI.


Decorators

@shop.on_purchase

@shop.on_purchase
def purchased(player, item, price, shop):
    player.send_message(f"Bought {item.name} for {price}!")