Resource icon

Experimental MenuAPI 0.1 beta

Compatible API Versions
1.0
Sourcecode
https://github.com/Ragnok123/MenuAPI
PLANS:
FORMS MENU (NOT FINISHED)



To create new inventory menu, you should do this:

Code:
InventoryMenu menu = new InventoryMenu();
Every menu has a category. It is made to avoid bilion times changing menu content;
To create new category, you can simply do this:

Code:
InventoryCategory category = new InventoryCategory();
You can add items to your category:
Code:
java
category.addElement(int position, ItemData data);
*Position* - It is slot. You're writing it cause it's required
*ItemData* - Object, created for managing items. In future it planned to use nbt things and more
You can also manage item clicking:
Code:
  category.addElement(int position, ItemData data, new ItemClick(){
      @Override
       public void onClick(Player player, Item item){
           player.sendMessage("Item clicked");
       }
  });
After you've added all items, dont forget add reference to menu:
Code:
category.setMenu(menu);
You can set category as main category (when menu opens):
Code:
menu.setMainCategory(category);
Or just add as another category:
Code:
menu.addCategory(String id, category);
Making custom text is also easy:
Code:
menu.setName("§l§eMenu");
If you want only read menu without transactions, just make:
Code:
menu.setOnlyRead(true);
To send menu, just use
Code:
menu.show(player);
Or force close with
Code:
menu.forceDestroy(player);
And finally, register new menu:
Code:
InventoryMenuHandler.registerNewMenu(String id, menu);
Author
Ragnok123
Downloads
1,280
Views
4,024
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Ragnok123

Top