Skip to content

Other Syntax

Patrick Miller edited this page Jul 17, 2026 · 1 revision

There is some additional syntax provided by skript-gui that you can read about below.

(Expression) GUI of Player

An expression to obtain the GUI the player has open.

[the] gui of %players%
%players%'[s] gui

(Condition) Has GUI

A condition to check whether the player has a GUI open.

%players% (has|have) a gui [open]
%players% (doesn't|does not|do not|don't) have a gui [open]

(Expression) Next GUI Slot

An expression to obtain the next open slot of a GUI. This is a single character representing the next available character of the layout.

[the] next gui slot[s] of %guis%
%guis%'[s] next gui slot[s]
[the] next gui slot

Note

The third pattern is only available within GUI sections.

(Expression) Paginated List

This is a utility expression for interpreting a list of values as pages. For example, for a list with 20 values, the second page (assuming 10 items per page) would contain elements 11 through 20.

page[s] %numbers% of %objects% with %number% (lines|values)

Consider this example of starter code for a small shop GUI where you can flip through the pages:

command /paginatedgui:
	trigger:
		set {_items::*} to grass block, dirt, dirt path, stone, andesite, and diorite
		set {_last_page} to (size of {_items::*}) / 3
		set {-page::%player%} to 1
		create a gui with virtual chest inventory with 1 row named "Shop" with layout "p--abc--n":
			make gui slot "p" with arrow named "Previous Page":
				if {-page::%player%} is greater than 1:
					subtract 1 from {-page::%player%}
					set_gui_page(gui, {_items::*}, {-page::%player%})
			make gui slot "n" with arrow named "Next Page":
				if {-page::%player%} is less than {_last_page}:
					add 1 to {-page::%player%}
					set_gui_page(gui, {_items::*}, {-page::%player%})
			set_gui_page(gui, {_items::*}, {-page::%player%})
		open the last created gui for the player
function set_gui_page(gui: gui, items: items, page: number):
	set {_page_items::*} to page {_page} of {_items::*} with 3 values
	edit {_gui}:
		make gui slot "a" with {_page_items::1}
		make gui slot "b" with {_page_items::2}
		make gui slot "c" with {_page_items::3}
skript-gui-paginated-list.mov

Clone this wiki locally