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

🛠️ Features

  • Anti-Steal: Players cannot drop, move, or swap these items.
  • Auto-Restore: If a button is lost (e.g., due to a server crash or world change), the extension automatically re-populates the designated slot.
  • NBT-Based: Buttons are identified by unique Persistent Data (PDC) keys, ensuring regular items with the same material are never affected.

📦 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: You can place an item in Slot 0 (Result) to act as a “Submit” or “Process” button that triggers a script when clicked, while using Slots 1-4 as status indicators.

⚙️ Technical Details

The InventoryButtonService monitors:
  • InventoryClickEvent: Cancels any attempt to pick up or move the button.
  • InventoryDragEvent: Prevents dragging buttons across slots.
  • PlayerDropItemEvent: Blocks dropping the buttons on the ground.
  • PlayerSwapHandItemsEvent: Prevents swapping buttons to the off-hand.

💻 Example Usage

inventoryButtons:
  - slot: 1 # Top-left of the 2x2 grid
    isCraftingGrid: true
    item:
      type: "NETHER_STAR"
      name: "<gold>Character Menu"
      lore:
        - "<gray>Click to open your stats."
    actions:
      - "open_character_gui_action"