Skip to content

3. Working with a SimpleGui

LitleProgrammer edited this page May 12, 2024 · 1 revision

Creating a SimpleGui

Creating a gui is easy.

  1. You need to create all your components, as you can see here: creating components
  2. Create a new SimpleGui
SimpleGui gui = new SimpleGui("Some title") 
  1. Add a text as content
SimpleGui gui = new SimpleGui("Some title")
                .addContent(text)
  1. Add up to 3 buttons
SimpleGui gui = new SimpleGui("Some title")
                .addButton(button)
  1. Put everything together and it can look like this
SimpleGui gui = new SimpleGui("Some title")
                .addContent(text)
                .addButton(button)
                .addButton(button2)
                .addButton(button3);
  1. The last step is to open the the gui to a player
gui.open(player);

Using the SimpleGui

isOpen()

description: returns, weather the gui is open or not
parameters: none
returns: boolean

getComponent()

description: gets a component by it's UUID
parameters: UUID uuid -> the components UUID
returns: Component component

Clone this wiki locally