Sueta

BungeeInventories

1.1

A simple API to let players open inventories via bungeecord

·Plugin

Documentation
Better Readable Description on Github
This is a beta version.
If there's an issue please report it on
the Discord Server

Setup

Download the newest version of the API's and import them into you're plugins You don't have to make a Spigot Plugin with the Library, only if you want to change something described in the following spigot documentation Don't export the Libraries, just put them on your servers as plugins.

Bungeecord

Creating an Inventory:

BungeeInventory chestInventory = new BungeeInventory("§7Server-GUI", 3*9);

BungeeInventory furnaceInventory = new BungeeInventory("§7Multi Server Furnace", InventoryType.FURNACE);

Filling an Inventory:

ItemStack lobbyItem = new ItemStack("CLOCK", "§6Lobby", "§7Click to be send to the Lobby");
ItemStack pvpItem = new ItemStack("DIAMOND_SWORD", "§bPvP");

inventory.addItem(pvpItem);
inventory.setItem(15, lobbyItem);

Sending an Inventory:
You can choose an OpenInventoryType to choose when the inventory should open or not. Default value is OpenInventoryType.ALWAYS

BungeeInventoryManager.getInstance().sendInventory(player, inventory);

BungeeInventoryManager.getInstance().sendInventory(player, inventory, OpenInventoryType.ONLY_WHEN_INVENTORY_CLOSED);

Overwrite maySendInventory:
With overwriting this Factory you can block sending specified inventories when a condition is true or lots of other Things. This Factory returns a boolean.

BungeeInventoryManager.getInstance().setMaySendInventory((player, inventory) -> {
   if (...) {
       // Inventory will be sent to Spigot Server
       return true;
   }
   // Inventory will not be sent to Spigot Server
   return false;
 });

Spigot

Overwrite mayOpenInventory
With overwriting this Factory you can block sending specified inventories when a condition is true or lots of other Things like play Sounds. This Factory returns a boolean.

BungeeInventoryManager.getInstance().setMayOpenInventory((player, inventory) -> {
   if (...) {
       // Inventory will be opened
       return true;
   }
   // Inventory will not be opened
   return false;
 });

| Github | Discord |

Similar projects

Plugin →