Sueta

Simple GUI | Create GUI in 10 seconds!

1.0

Making GUI's in Minecraft was never easy as now!

·Plugin

GUI Api

Simple Api That have own events inside, simple methods to create ItemStack or fast checker.

1. Put my Api in plugins folder inside your minecraft server.

2. If you're using Eclipse, right click on you project --> Properties. On the left bar select Java Build Path. On right side click Add External JARs... And click my Api.

3. Main class must implement Listener class. Don't forget to put register Events method in onEnable! :)

4. To create empty GUI use:

GUI gui = new GUI(String title, int size, int yourOwnId);

Or

GUI gui = new GUI(String title, InventoryType type, int yourOwnId);

5. Adding items to GUI

You can add head item or normal item.

Head :

gui.setHead(String nick, int index)

Or

gui.setHead(String nick, int index, List<String> lore)

Items :

setItem(int index, Material m, short bit)

Or

setItem(int index, Material m, short bit, String title)

Or

setItem(iint index, Material m, short bit, String title, List<String> lore)

Bit is data.

6. Opening and closing GUI:

gui.setTo(Player player)

It will call onGuiOpenEvent.

To close use simply Inventory method:

event.getPlayer().getInventory().close();

Attention ! When closing Inventory make sure you wait 1 tick before you close it! When you don't wait 1 tick, and Player Shift clicked an item from GUI, he will be given with this item!

7. Events

- onGuiChangeEvent - Called when player has opened gui and it changed.
- onGuiClose - Called when player close gui.
- onGuiItemClickEvent - Called when player click item in gui, not in his inventory.
- onGuiOpenEvent - Called when player open gui from gui.setTo(Player p)
- onGuiShiftClickFromBottomInventoryEvent - Called when player shift click an item from his inventory to gui.

8. Classes

Main - call Events
GUI - Object with methods inself
GPlayers - List of Players who's are having opened gui.
Check - Class with two methods.

9. Check class

In check class are two methods.

twoItems which return boolean if two items are same

twoItems(ItemStack one, ItemStack two)

Or

twoItemsNoLore(ItemStack one, ItemStack two)

And fastItem

fastItem(Material m, int size, short bit, String Display, List<String> lore)

Or

fastItem(Material m, int size, short bit, String Display)

And that's it!
Hope you liked it.

If there's a bug let me know and I will fix it!

Soon!

Similar projects

Plugin →