XaGui Docs
Examples

Paginator

To use a paginator for your GUI, you need to call .addPaginator() method on your GuiMenu object.
This will add a paginator to your GUI that will allow you to switch between pages.

By default, it uses Material.ARROW for previous and next buttons.
You can also specify your own items for previous and next buttons using .setPreviousPageButton() and .setNextPageButton() on GuiMenu object methods.

Or specify pagination items for every gui using XaGui#setPreviousPageButton() and XaGui#setNextPageButton() methods which both accept ItemStack as a parameter.
To add sound when switching pages, you can use .setPageSwitchSound() method on GuiMenu object. \

Example

GuiInterface gui = getGui();
 
gui.fillBorder(); // Optional
 
gui.setNextPageButton(new ItemStack(Material.BLAZE_ROD));
 
gui.setPageSwitchSound(Sound.ITEM_BOOK_PAGE_TURN);
 
gui.setSlot(0, 4, Material.DIAMOND); // 1th page 4th slot
gui.setSlot(1, 4, Material.EMERALD); // 2th page 4th slot
gui.setSlot(2, 4, Material.GOLD_INGOT); // 3th page 4th slot
 
gui.setSlot(2, 13, testItem); // 3th page 13th slot
 
gui.setSlot(3, 4, Material.IRON_INGOT); // 4th page 4th slot
gui.setSlot(4, 4, Material.COAL); // 5th page 4th slot
 
gui.addPaginator(); // Adding the paginator
 
gui.addCloseButtonAllPages(); // Optional

On this page