An open API service indexing awesome lists of open source software.

https://github.com/CodeBrainTR/HanGuiBuilder

A simple GUI builder API for Minecraft spigot plugins
https://github.com/CodeBrainTR/HanGuiBuilder

gui-for-minecraft gui-for-spigot minecraft minecraft-plugin spigot spigot-api spigot-gui spigot-library spigot-plugin spigot-plugin-api

Last synced: 8 months ago
JSON representation

A simple GUI builder API for Minecraft spigot plugins

Awesome Lists containing this project

README

          

What is this project?
HanGuiBuilder is a Minecraft Spigot plugin API that is designed for developers. It simplifies the process of building GUIs and assigning commands to items within them, and is compatible with all versions of Minecraft.

```


jitpack.io
https://jitpack.io


com.github.BingulHan
HanGuiBuilder
1.3

```
Example:
```

ItemStack information = new ItemStack(Material.PAPER);
ItemMeta meta = information.getItemMeta();
meta.setDisplayName(ChatColor.YELLOW+"Info");
information.setItemMeta(meta);

HanGuiBuilder guiBuilder = new HanGuiBuilder(HanGuiBuilder.Size.THREE, this).
setAccessibleOnDragItems(false).
addPlayer(event.getPlayer()).
addItem(1, new GuiItem(new ItemStack(Material.GRASS), (p,g,slot) -> {

p.sendMessage(ChatColor.GREEN+"You touched the grass!");
g.getPlugin().getServer().broadcastMessage(""+p.getName()+" touched the grass!");

})).
addItem(2, new GuiItem(information, (p,g,slot) -> {

if (g.getData("information").isPresent()) {
p.sendMessage(ChatColor.WHITE+g.getData("information").get().getT().toString());
}

}));

guiBuilder.addData("title", "&a&lEXAMPLE GUI");
guiBuilder.addData("information", "You can add unlimited items, unlimited players to the GUI. You can also add custom data to the gui. (Any kind of data can be added.)");

if (guiBuilder.getData("title").isPresent()) {
guiBuilder.setGuiTitle(String.valueOf(guiBuilder.getData("title").get().getT()));
}

guiBuilder.open();

```