Skip to content

Instantly share code, notes, and snippets.

@underscore95
Last active January 1, 2026 13:34
Show Gist options
  • Select an option

  • Save underscore95/8dfcf234891e480dd200943e7fcda493 to your computer and use it in GitHub Desktop.

Select an option

Save underscore95/8dfcf234891e480dd200943e7fcda493 to your computer and use it in GitHub Desktop.
# Copyright (c) 2025 underscore95
# Licensed under MIT: https://opensource.org/license/mit
# Video Tutorial: https://youtu.be/eyjqABRSZjQ
function openGui(player: player):
if {gold::%{_player}%} is not set:
set {gold::%{_player}%} to 0
set {_gui} to chest inventory with 6 rows named "&6Tutorial"
set {_item} to gold block named "&6Gold: %{gold::%{_player}%}%" with lore "&7Click me!"
set slot 0 of {_gui} to {_item}
open {_gui} to {_player}
set metadata tag "currentGui" of {_player} to "tutorial-gui"
command /gui:
trigger:
openGui(player)
on inventory click:
set {_tag} to metadata tag "currentGui" of player
if {_tag} is "tutorial-gui":
cancel event
if clicked slot is 0:
send "You clicked!" to player
add 1 to {gold::%player%}
openGui(player)
on inventory close:
set {_tag} to metadata tag "currentGui" of player
if {_tag} is "tutorial-gui":
send "You closed the tutorial gui!" to player
delete metadata tag "currentGui" of player
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment