HomeJavaModslayout
layout
layout — screenshot 1layout — screenshot 2layout — screenshot 3

layout


License Discord

Layout is a modern, modular library designed to simplify the creation and management of interactive inventories in Minecraft using the Bukkit API. It provides a fluid syntax and complete control over your menu's behavior, allowing you to build GUIs quickly and efficiently.



nothing
If you need help, join the discord server.


Key Features

Sized and Fixed Inventories

Create inventories of variable size (like chests) or fixed size (like crafting tables and anvils), adapting to your project's needs.

Full Customization

Control every aspect of your menus:

Modular Design

The library is divided into modules that facilitate organization and scalability:


Developer Benefits

Example usage

Click here for more usage examples and documentation.

final LayoutSizedInventory layoutSizedInventory = Layout.sized()
        .title(Component.text("This is a sized example menu!", NamedTextColor.BLACK))
        .size(5)

        // Add a clickable item with multiple click handlers
        .item(22, ClickableItemLayout.builder()
                .material(Material.NETHERITE_PICKAXE)
                .displayName(Component.text("Netherite Pickaxe", NamedTextColor.GREEN))
                .lore(
                        Component.text("Line 1", NamedTextColor.GREEN),
                        Component.text("Line 2", NamedTextColor.LIGHT_PURPLE)
                )
                .onLeftClick(clickContext -> clickContext.player().sendMessage("Left click!"))
                .onRightClick(clickContext -> clickContext.player().sendMessage("Right click!"))
                .onMiddleClick(clickContext -> clickContext.player().sendMessage("Middle click!"))
                .build()
        )

        // Fill specific rows and columns with items
        .row(1, ItemLayout.display(Material.RED_STAINED_GLASS_PANE))
        .row(3, ItemLayout.display(Material.GREEN_STAINED_GLASS_PANE))
        .column(2, ItemLayout.display(Material.LIME_STAINED_GLASS_PANE).buil)
        .column(6, ItemLayout.display(Material.LIGHT_BLUE_STAINED_GLASS_PANE))

        // Define inventory behavior
        .behavior(layoutBehaviorBuilder -> layoutBehaviorBuilder
                .cancelAllClicks(false)
                .cancelLayoutClicks(true)
                .allowPlayerInventoryClicks(true)
                .ignoreEmptySlots(true)
                .onClick(context -> context.player().sendMessage("Clicked on inventory!"))
                .onOpen(openContext -> openContext.player().sendMessage("Inventory opened!"))
                .onClose(closeContext -> closeContext.player().sendMessage("Inventory closed!"))
        )

        .build();

layoutSizedInventory.open(player);
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.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more