- Item Price Methods - Get buy/sell prices for any ItemStack
- Item Availability - Check if items can be bought or sold
- Player Inventory - Calculate total sell value of inventory
- Custom Item Registry - Register custom items from other plugins
- Shop Integration - Programmatically interact with shop system
- Event Handling - Listen to buy/sell events
- Player Statistics - Access player purchase/sale statistics
// Get sell price for an item
ItemStack item = new ItemStack(Material.DIAMOND, 1);
double sellPrice = MrUltimateShopAPI.getItemStackPriceSell(item);
// Get buy price for an item
double buyPrice = MrUltimateShopAPI.getItemStackPriceBuy(item);
// Check if item can be sold/bought
boolean canSell = MrUltimateShopAPI.canSellItem(item);
boolean canBuy = MrUltimateShopAPI.canBuyItem(item);
// Register a single custom item
ItemStack customItem = new ItemStack(Material.DIAMOND_SWORD);
ItemMeta meta = customItem.getItemMeta();
meta.setDisplayName("§6Legendary Sword");
customItem.setItemMeta(meta);
MrUltimateShopAPI.registerItem("MyPlugin", "legendary_sword", customItem);
// Use in shop config as: Material: "MyPlugin:legendary_sword"
public class MyCustomItemProvider implements CustomItemProvider {
@Override
public String getPluginName() {
return "MyPlugin";
}
@Override
public ItemStack getCustomItem(String itemName) {
switch (itemName) {
case "magic_wand":
ItemStack wand = new ItemStack(Material.STICK);
ItemMeta meta = wand.getItemMeta();
meta.setDisplayName("§dMagic Wand");
wand.setItemMeta(meta);
return wand;
default:
return null;
}
}
@Override
public boolean hasCustomItem(String itemName) {
return "magic_wand".equals(itemName);
}
@Override
public String[] getAvailableItems() {
return new String[]{"magic_wand"};
}
}
// Register the provider
MrUltimateShopAPI.registerItemProvider(new MyCustomItemProvider());
// Get total items purchased/sold by a player
long totalPurchased = MrUltimateShopAPI.getPlayerTotalPurchasedItems(player);
long totalSold = MrUltimateShopAPI.getPlayerTotalSoldItems(player);
// Get total money spent/earned by a player
double totalSpent = MrUltimateShopAPI.getPlayerTotalSpending(player);
double totalEarned = MrUltimateShopAPI.getPlayerTotalEarnings(player);
// Get specific item statistics
long itemPurchased = MrUltimateShopAPI.getPlayerItemPurchaseCount(player, item);
long itemSold = MrUltimateShopAPI.getPlayerItemSaleCount(player, item);
double itemSpent = MrUltimateShopAPI.getPlayerItemSpending(player, item);
double itemEarned = MrUltimateShopAPI.getPlayerItemEarnings(player, item);
<repository>
<id>mrneznamy-releases</id>
<url>https://depency.mrneznamy.eu/repository/maven-releases/</url>
</repository>
<dependency>
<groupId>eu.mrneznamy</groupId>
<artifactId>MrUltimateShop</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>