Skip to content

Feature - Inventory & Chat Buttons - #304

Merged
ItsNature merged 7 commits into
version/1.2.9from
feature/inventory-and-chat-buttons
Aug 17, 2026
Merged

ItsNature merged 7 commits into
version/1.2.9from
feature/inventory-and-chat-buttons

Conversation

@ItsNature

@ItsNature ItsNature commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Description:
Add Inventory Buttons and Chat Buttons, letting servers display clickable buttons on the player inventory and on the chat screen. Buttons are built on a new shared button system: they mix adventure components and icons inside a single button, support tooltips, custom shape/size/position, custom and hover colors, click actions, and live content and tooltips that re-resolve per viewer and resend automatically.

Full Docs:

Changes:

  • New shared button system ApolloButton:
    • ApolloButtonContent builder: text, icon and live content parts, content scale
    • ApolloButtonTooltip: static lines or a live resolver
    • ApolloButtonAction: runCommand, openUrl, clientAction (OPEN_MINIMAP_VIEW, OPEN_WAYPOINTS_MENU)
    • ApolloButtonShape: (ROUNDED_SQUARE, CIRCLE)
    • ApolloButtonSize
  • New InventoryModule API:
    • displayInventoryButtons(Recipients, Collection<InventoryButton>) & displayInventoryButton(Recipients, InventoryButton)
    • removeInventoryButton(Recipients, String) & removeInventoryButton(Recipients, InventoryButton)
    • resetInventoryButtons(Recipients)
    • updateInventoryButton(Recipients, String, ApolloButtonContent, ApolloButtonTooltip), updateInventoryButtonContent(...) & updateInventoryButtonTooltip(...)
    • New InventoryButton builder: box (LEFT/RIGHT), inventoryType, size presets & default colors
  • New ChatModule API:
    • displayChatButtons(Recipients, Collection<ChatButton>) & displayChatButton(Recipients, ChatButton)
    • removeChatButton(Recipients, String) & removeChatButton(Recipients, ChatButton)
    • resetChatButtons(Recipients)
    • updateChatButton(Recipients, String, ApolloButtonContent, ApolloButtonTooltip), updateChatButtonContent(...) & updateChatButtonTooltip(...)
    • New ChatButton builder with chat size presets
  • New options on both modules:
    • buttons.live-broadcast (default false): automatically re-resolves and re-sends live button content on each piece's own update interval; combined with the packet enrichment module, updates are only sent to players who currently have their inventory/chat open
    • buttons.send-defaults (default false) & buttons.defaults: define static buttons directly in config.yml, displayed automatically when a player joins
  • Packet Enrichment Module: new player-inventory-open / player-inventory-close packets and ApolloPlayerInventoryOpenEvent / ApolloPlayerInventoryCloseEvent

Code Example:

public void displayChatButtonsExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        ChatButton teamChat = ChatButton.builder()
            .id("team-chat")
            .position(HudPosition.of(0, 2))
            .size(ApolloButtonSize.of(70, 16))
            .shape(ApolloButtonShape.ROUNDED_SQUARE)
            .backgroundColor(ChatButton.DEFAULT_BACKGROUND_COLOR)
            .borderColor(ChatButton.DEFAULT_BORDER_COLOR)
            .content(ApolloButtonContent.builder()
                .append(ItemStackIcon.builder()
                    .itemName("SHIELD")
                    .build())
                .append(Component.text("Team Chat", NamedTextColor.GREEN))
                .scale(1.0F)
                .build())
            .tooltip(ApolloButtonTooltip.of(
                Component.text("Click to switch!", NamedTextColor.YELLOW)))
            .onClick(ApolloButtonAction.runCommand("/channel team"))
            .build();

        this.chatModule.displayChatButtons(apolloPlayer, Arrays.asList(teamChat));
    });
}

Review Request Checklist

  • Your code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have tested this change myself. (If applicable)
  • I have made corresponding changes to the documentation. (If applicable)
  • The branch name follows the projects naming conventions. (e.g. feature/add-module & bugfix/fix-issue)

@ItsNature ItsNature added type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition labels Jul 29, 2026
@ItsNature
ItsNature force-pushed the feature/inventory-and-chat-buttons branch from 63352f1 to 2f74c99 Compare August 10, 2026 21:10
@ItsNature ItsNature mentioned this pull request Aug 11, 2026
@ItsNature
ItsNature marked this pull request as ready for review August 13, 2026 04:10
@ItsNature
ItsNature merged commit d653236 into version/1.2.9 Aug 17, 2026
1 check passed
@ItsNature
ItsNature deleted the feature/inventory-and-chat-buttons branch August 17, 2026 12:41
ItsNature added a commit that referenced this pull request Aug 19, 2026
* Deploy as `1.2.9-SNAPSHOT`

* Feature - Height Limit Module (#300)

* Height Limit Module

* Add default height limit config entry, more callouts & update example

* Document snake_case custom data keys (#301)

* Add `TransferModule#ping` validation & increase `PingRequest` timeout to 10s (#302)

* example(internal): npc visibility tracking (#303)

* Feature - Inventory & Chat Buttons (#304)

* Inventory & Chat Buttons

# Conflicts:
#	gradle/libs.versions.toml

* Add default chat & inventory buttons config option

* Add button docs

* Add button images to docs

* Update inventory.mdx

* Update chat.mdx

* Remove temp gradle publish

---------

Co-authored-by: Trentin <25537885+TrentinTheKid@users.noreply.github.com>

* Add `NametagVisibilityOverride` to `Nametag` (#305)

# Conflicts:
#	gradle/libs.versions.toml

* Sync LunarClient Mods & Options (#307)

* Sync LunarClient Mods & Options

* Update version tags to 1.2.9

---------

Co-authored-by: LunarClient Bot <lc-bot@moonsworth.com>

* Bump to 1.2.9 (#308)

---------

Co-authored-by: Trentin <25537885+TrentinTheKid@users.noreply.github.com>
Co-authored-by: LunarClient Bot <lc-bot@moonsworth.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition

Development

Successfully merging this pull request may close these issues.

3 participants