Skip to content
home/templates/paginated chest gui menu
guiAdvancednewmc 1.20.x – 1.21.x48 lines

paginated chest gui menu

gui helper for browsing a long list across multiple pages. hard-coded item list + auto-generated next/prev/close navigation row.

vanilla Skriptno addons required.
paginated-menu.sk48 lines
# Paginated chest GUI — solves the recurring "how do I show 50+ items in a
# chest GUI" pain point. Items per page = 45 (top 5 rows), bottom row is nav.

options:
    page_size: 45
    nav_back: 48      # bottom row, 4th slot
    nav_close: 49     # bottom row, 5th slot
    nav_next: 50      # bottom row, 6th slot

function openPaginatedMenu(p: player, page: number):
    set {_gui} to chest inventory with 6 rows named "&aBrowse — Page %{_page}%"
    set {_total} to size of {browse.items::*}
    set {_start} to ({_page} - 1) * {@page_size} + 1
    set {_end} to {_page} * {@page_size}
    if {_end} > {_total}:
        set {_end} to {_total}
    set {_slot} to 0
    loop {_start} to {_end}:
        set slot {_slot} of {_gui} to {browse.items::%loop-value%}
        add 1 to {_slot}
    # Nav row
    if {_page} > 1:
        set slot {@nav_back} of {_gui} to arrow named "&7← Previous page"
    set slot {@nav_close} of {_gui} to barrier named "&cClose"
    if ({_page} * {@page_size}) < {_total}:
        set slot {@nav_next} of {_gui} to arrow named "&7Next page →"
    set {browse.page.%uuid of {_p}%} to {_page}
    set {browse.gui.%uuid of {_p}%} to {_gui}
    open {_gui} to {_p}

on inventory click:
    if event-inventory is {browse.gui.%uuid of player%}:
        cancel event
        if index of event-slot is {@nav_back}:
            openPaginatedMenu(player, {browse.page.%uuid of player%} - 1)
        else if index of event-slot is {@nav_next}:
            openPaginatedMenu(player, {browse.page.%uuid of player%} + 1)
        else if index of event-slot is {@nav_close}:
            close player's inventory

# Example: fill the list and open
command /browse:
    trigger:
        # Demo data — replace with your real list
        loop 60 times:
            set {browse.items::%loop-number%} to diamond named "&bDiamond #%loop-number%"
        openPaginatedMenu(player, 1)

get it running

paginated-menu.sk · 48 lines · vanilla Skript
  1. 1

    copy or download

    grab the .sk file with the buttons up top.

    paginated-menu.sk· ready to drop in
  2. 2

    drop it in your scripts folder

    save it exactly here on your server — no typos, just copy the path:

    …/plugins/Skript/scripts/paginated-menu.sk
  3. 3

    reload in-game

    run this in chat or console — your script goes live instantly:

    /sk reload paginated-menu
that's it — your script is live. hop in-game to try it.
/ related templates

more gui templates

comments