[API] MenuBuilder 1.1.0-SNAPSHOT

Easily create Inventory and Chat Menus

  1. inventivetalent
    This API allows you to easily create Inventory Menus and Chat Menus.



    Examples

    Inventory

    Simple inventory with one item and the title "My custom inventory"
    Code (Java):

    new InventoryMenuBuilder().withSize(9).withTitle("My custom inventory").withItem(4, new ItemStack(Material.STONE)).show(player);
     
    [​IMG]

    Item with a custom click listener
    Code (Java):

    new InventoryMenuBuilder().withSize(9).withTitle("My custom inventory").withItem(4, new ItemStack(Material.STONE), new ItemListener() {
                @Override
                public void onInteract(Player player, ClickType action, ItemStack item) {
                    player.sendMessage("You left-clicked me!");
                }
            }, ClickType.LEFT).show(player);
     

    Chat
    Simple text-only menu
    Code (Java):

    new ChatMenuBuilder().withLine("This is the first line", "This is the second line", "...").show(player);
     
    [​IMG]

    Text with a custom click listener
    Code (Java):

    new ChatMenuBuilder().withLine(new LineBuilder().append(new ChatListener() {
                @Override
                public void onClick(Player player) {
                    player.sendMessage("You clicked me!");
                }
            }, new TextComponent("Click me!"))).show(player);
     
    [​IMG]
    If you click it, it will call the code of the listener:
    [​IMG]


    Custom components - Checkbox
    Code (Java):

    new ChatMenuBuilder().withLine(new LineBuilder().append(new MenuComponentCheckbox().onChange(new ValueListener<Boolean>() {
                @Override
                public void onChange(Player player, Boolean oldValue, Boolean newValue) {
                    player.sendMessage("You changed the value! " + oldValue + " -> " + newValue);
                }
            }))).show(player);
     
    [​IMG]
    Every time you click it, it will call the value change and update the displayed checkbox
    [​IMG][​IMG]



    Maven

    Code (Text):
    <repositories>
        <repository>
            <id>inventive-repo</id>
            <url>https://repo.inventivetalent.org/content/groups/public/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.inventivetalent</groupId>
            <artifactId>menubuilder</artifactId>
            <version>1.0.2</version>
        </dependency>
    </dependencies>


    Links


    Please leave a rating if you like this resource.
    Donations to support me or this resource are also very much appreciated.
    Hypov, DrkMatr1984, NickAc and 9 others like this.

Recent Updates

  1. 1.11 support
  2. Minor change
  3. Listener unregister methods

Recent Reviews

  1. Rezz
    Rezz
    5/5,
    Version: 1.1.0-SNAPSHOT
    Easy to use. Lovely to develop with!
    This plugin is beautiful.
  2. TJPlaysNow
    TJPlaysNow
    5/5,
    Version: 1.0.2
    This plugin API is amazing, it helps keeping things organized, easy to use and I love it! I've used it for one of my plugins already and I will use it for many more to come.
  3. Franz-san
    Franz-san
    5/5,
    Version: 1.0.2
    THIS RESOURCE API GETS FROM ME THE FOLLOWING RATING

    A++

    5/5

    THIS RESOURCE IS VERY GOOD, APPROVED!
  4. EnderSandman
    EnderSandman
    5/5,
    Version: 1.0.1
    This is a very useful API and is really easy to use. The classes are layed out very well and coded really well.