UiPlusPlus

UiPlusPlus 0.1

Native Minecraft Version:
1.19
Tested Minecraft Versions:
1.19
This Is A Plugin For Devs

to make a UI use:
Code (Java):
ui = new gui(9, "TEST", Material.BLACK_STAINED_GLASS_PANE, player);
to set a item use:
Code (Java):
ui.setUiItem(4, new UiItem(Material.DIAMOND, "name", player, "lore"));
to make a button use:
Code (Java):
ui.setUiItem(3, new UiButton(Material.DIAMOND_AXE, "name", player, "lore", getClass().getMethod("method",null), this));
the method is:
Code (Java):
public void test()
{
_player.getInventory().addItem(new ItemStack(Material.DIAMOND, 1));
}
this is a button list with placeholders and custom draw:
Code (Java):
List<UiButton> Items = new ArrayList<>(2);
try {
Items.add(0, new UiButtonCustomDraw(Material.GREEN_TERRACOTTA, "%player_time%", player, "", getClass().getMethod("method",null), this, getClass().getMethod("CustomDraww", UiItem.class, int.class), this, null));
Items.add(1, new UiButtonCustomDraw(Material.BLACK_CANDLE, "%player_time%", player, "", getClass().getMethod("method",null), this, getClass().getMethod("CustomDraww", UiItem.class, int.class), this, null));
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
ui.setUiItem(5, new UiButtonList(Material.MAGENTA_TERRACOTTA, "A List", player, "TEST", Items, ui, 2, 5));
this is the CustomDraww:
Code (Java):
public void CustomDraww(UiItem uii, int Slot)
{
UiButton Uibutton = (UiButton)uii;
if (Float.parseFloat(PlaceholderAPI.setPlaceholders(_player, "%player_health%")) == 20)
{
Uibutton.SetGlow(true);
Uibutton.canTrigger = true;
}
else
{
Uibutton.SetGlow(false);
Uibutton.canTrigger = false;
}

_ui.setUiItemFromDrawMethod(Slot, Uibutton);
}
Author
Mined
Downloads
8
Views
31
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Mined

Top