Skip to content

Adding new items to the dock

SamJakob edited this page Dec 16, 2017 · 1 revision

Description: This guide will show you how to add new items to the dock/toolbar.
Time: less than 1 minute
Difficulty: 2/5 (Easy)


The dock/toolbar is the row of icons that appears when there are multiple pages. It contains the current page indicator and previous/next page buttons.

  • Simply create new GUIButtons and add them to the toolbarItems map. For example:
// Create a new GUIButton
GUIButton myCustomDockButton = new GUIButton(
    ItemBuilder.start(Material.DIRT).name("&d&lCustom Button").build()
);

// TODO: Set a listener for the dock GUI button.

// 0 is the slot.
toolbarItems.add(0, myCustomDockButton);

Just make sure that you don't accidentally override the pagination buttons!

DEPRECATED

This API is deprecated in favor of my improved rewrite, SpiGUI.

Clone this wiki locally