Skip to main content
Inventory Buttons are items that the InputTracker “pins” to specific slots in a player’s inventory or crafting grid. These items are strictly managed to be interactive but non-removable.

Features

  • Anti-Theft: Players cannot drop, move, or swap these items.
  • Auto-Restore: If a button is lost (e.g., server crash, world change), the extension automatically re-populates the designated slot.
  • PDC-Based: Buttons are identified by unique Persistent Data Container keys — regular items with the same material are never affected.
  • 7 Click Types: Each binding supports LEFT, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, DROP, DOUBLE_CLICK, and ALL fallback.
  • Criteria Support: Both the button and each click binding can have their own criteria conditions.
  • World Interaction: Buttons in the hotbar trigger LEFT/RIGHT actions when used in the world.

Crafting Grid Buttons

A unique feature of this extension is the ability to place buttons within the 2x2 (Inventory) or 3x3 (Workbench) crafting grid.
  • Slot 0: The crafting result slot.
  • Slots 1-4: The crafting matrix slots.
By setting isCraftingGrid: true, you can turn the crafting area into a permanent control panel for your players.
Pro Tip: Place an item in Slot 0 (Result) to act as a “Submit” or “Process” button. Use Slots 1-4 as status indicators.

Crafting Safety

If a button occupies any crafting matrix slot (1-4), the crafting result is automatically nullified to prevent item duplication.

Click Type Reference

ClickTypeDescriptionWorld Interact
ALLMatches any click (fallback)
LEFTLeft click
RIGHTRight click
SHIFT_LEFTShift + left click✓*
SHIFT_RIGHTShift + right click✓*
DROPQ key when hovering the button
DOUBLE_CLICKDouble click
*World interaction for SHIFT types uses the binding’s global click type — only LEFT/RIGHT are detected from PlayerInteractEvent.

How it Works

The InventoryButtonService monitors these events:
EventPurpose
InventoryClickEventHandle button clicks, prevent moving to cursor
InventoryDragEventPrevent dragging buttons
PlayerDropItemEventBlock dropping buttons, trigger DROP actions
PlayerSwapHandItemsEventPrevent swapping buttons
PlayerInteractEventCancel world interaction, trigger LEFT/RIGHT
PlayerInteractEntityEventCancel entity interaction, trigger RIGHT
PlayerJoinEventPopulate buttons on join
PrepareItemCraftEventHandle result buttons, prevent crafting with buttons
InventoryCloseEventClean up crafting grid buttons, restore positions

Example Configuration

inventoryButtons:
  - slot: 1
    isCraftingGrid: true
    item:
      type: "NETHER_STAR"
      name: "<gold>Character Menu"
      lore:
        - "<gray>Click to open your stats."
    clickActions:
      - clickType: LEFT
        actions:
          - "open_character_gui_action"
      - clickType: RIGHT
        actions:
          - "open_settings_action"