Home›Java›Mods›[API] MenuBuilder
ModsJava

[API] MenuBuilder

Minecraft Java mod. Download on the author's site.

⬇ Download on Spigot
This API allows you to easily create Inventory Menus and Chat Menus .


[​IMG]
I enjoy making all of my plugins for free, but I need your help to keep them for free.
​

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.
​
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

[API] MenuBuilder is a free Minecraft Java mod. Downloaded 7,616 times (via Spigot). Download it and open it directly in the game.

Explore more