Skip to content
stefvanschie edited this page May 17, 2024 · 2 revisions

Languages: Dutch (Nederlands)

The PagingButtons component provides a simple way for users to change pages in a PaginatedPane. The component consists of two items that provide a way for the player to go back or forward a page. The items are placed at the first and last slot of the component. If the player is at the first or last page, the back or forward item will be invisible.

PaginatedPane pages = ...; // the pages to change by the buttons

PagingButtons pagingButtons = new PagingButtons(Slot.fromXY(0, 0), 9, pages);

By default, both items will be arrows. You can change the items with the setBackwardButton and setForwardButton methods.

pagingButtons.setBackwardButton(new GuiItem(new ItemStack(Material.CANDLE));
pagingButtons.setForwardButton(new GuiItem(new ItemStack(Material.OXEYE_DAISY)));

XML

Everything from Panes also applies here.

Creating a paging buttons component can be done with pagingbuttons. The element must have a pages tag which references a PaginatedPane. This must be defined earlier in the document, you cannot reference a PaginatedPane that is defined below this element. The paginatedpane element should have an id tag which acts as the reference for the pagingbuttons element.

<paginatedpane x="0" y="0" length="9" height="6" id="paging" />

<pagingbuttons x="0" y="0" length="9" pages="paging" />
Clone this wiki locally