UltimateShop Wiki
  • 🎉Welcome
  • 🌏Other Language Wiki
  • 📦Info
    • ✅Requirements
    • ⚙️Install
    • 🔗Compatibility
    • 🛠️Configuration files
    • ⌨️Commands
    • 📊Data
    • 🚀Performance
    • ❓FAQ
    • 🆚Compare
  • 📋Format
    • 🛒Info of ItemFormat™
    • 📝ItemFormat™
    • 💹EconomyFormat™
    • 🖼️Display Item Format
    • 🎬Action Format
    • ⚖️Condition Format
    • ➗Math Calculate Format
  • 🔌Menus
    • 🔲General Menus
    • 🔽Buy More Menus
    • 🛏️Bedrock Menus - Premium
    • 🥉Display Item Add Lore
  • 🛍️Shops
    • 📂Shops
    • 🛒Products
    • 💰Products Config: Single Thing
    • ♻️Product Config: Buy/Sell Times Reset
    • 📚Common Examples
    • 🌱Example: Stock (like in life)
    • 📅Example: Daily Shops
    • 🏆Example: Daily Rewards
  • 📍Placeholders
    • 🔧Built-in Placeholder
    • 🔀Random Placeholder - Premium
    • ⛓️Conditional Placeholder - Premium
    • 🔖Example: Discount
  • 💰Dynamic Prices
    • 🔄Dynamic Price
    • 🔴Dynamic Price Status - Premium
  • ✨Features
    • 🎨Color Code
    • 💴Easy Prices
    • 🪄Sell Stick - Premium
    • 💾Saved Item
    • 🌍Localized Item Name - Premium
    • 🌐Multi Server Sync - Premium
    • 🔢Number Format
    • ✏️In-game Editor - Premium
    • 🎮Custom Click Event - Premium
    • 🔍Custom Item Match Method
    • 🔑Give Item Method
    • 💳Log Transaction - Premium
  • 💻Develop
    • Develop Guide
    • Events
    • Hook into UltimateShop
    • Can't do things
Powered by GitBook
On this page
  • Get shop object
  • Get product object
  • Start buy a product
  • Start sell a product
  • Get player cache object
  • Get server cache object
  1. 💻Develop

Develop Guide

Get shop object

ConfigManager.configmanager.shopConfigs.get(shopID);

Get product object

ObjectShop shop = ConfigManager.configmanager.shopConfigs.get(shopID);
if (shop == null) {
  return;
}
ObjectItem item = shop.getProduct("TEST");
List<ObjectItem> items = shop.getProductList();

Start buy a product

BuyProductMethod.startBuy(Inventory inventory, String shop, String product, Player player, boolean quick, boolean test, int multi);
  • inventory is Bukkit inventory object, for player's inventory, use player.getInventory() method.

  • shop is shop ID.

  • product is product ID.

  • quick is whether send message after buy (will still send if you enable send-message-after-buy option in config.yml)

  • test is whether take money or items from player, set it to true if you just want to know whether player has enough money or items.

  • multi is buy amount in one time, default set to 1.

Start sell a product

SellProductMethod.startSell(Inventory inventory, String shop, String product, Player player, boolean quick, boolean test, boolean ableMaxSell, int multi);
  • ableMaxSell is whether if player don't have enough money or items for now multi(amount) value, we will try to get max amount that player able to sell. Use for sell all command.

Get player cache object

CacheManager.cacheManager.playerCacheMap.get(player);

Can get player's buy times, sell times data and so on.

Get server cache object

CacheManager.cacheManager.serverCache;
Previous💳Log Transaction - PremiumNextEvents

Last updated 4 months ago