Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Added detailed code examples to README.md covering all core MenuAPI concepts.

Examples Added

  • Basic Menu: Simple menu creation and player opening
  • MenuItem: Three interaction patterns (close, teleport, item-giving)
  • MenuEditor: Custom dynamic content editor displaying player stats
  • MenuPagination: Three layout patterns (full, middle, custom slots)

Examples progress from basic to advanced, demonstrating practical use cases:

// Simple interactive button
setSlot(13, new MenuItem(teleportItem) {
    @Override
    public void click(Click click) {
        click.player().teleport(spawn);
        click.player().closeInventory();
    }
});

// Custom editor for dynamic content
public class PlayerStatsEditor implements MenuEditor {
    @Override
    public void edit(@NotNull Menu menu, @NotNull Inventory inventory) {
        // Updates menu with live player health, food, XP
    }
}

// Pagination with custom slot layout
MenuPagination pagination = MenuPagination.create(
    39, 41, PAGE_CHANGER, customSlots
);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…gination

Co-authored-by: SuperCrafting <73386929+SuperCrafting@users.noreply.github.com>
Copilot AI changed the title [WIP] Update README.md for clarity and examples Add comprehensive examples for Menu, MenuItem, MenuEditor, and MenuPagination Nov 19, 2025
Copilot AI requested a review from SuperCrafting November 19, 2025 10:30
@SuperCrafting SuperCrafting marked this pull request as ready for review November 19, 2025 10:32
@SuperCrafting SuperCrafting merged commit 4adc650 into readme Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants