GUIs
Creating a GUI
You can create a Gui using the builder:
Gui gui = Gui.chest()
.title(Component.text("A GUI"))
.rows(3)
.build();val gui = Gui.chest()
.title(Component.text("A GUI"))
.rows(3)
.build()A dropper or hopper can be created using their builders:
Gui gui = Gui.dropper()
.title(Component.text("A GUI"))
.build(); Gui gui = Gui.hopper()
.title(Component.text("A GUI"))
.build();val gui = Gui.dropper()
.title(Component.text("A GUI"))
.build()val gui = Gui.hopper()
.title(Component.text("A GUI"))
.build()Adding Buttons
A Button can be added by chaining a button(Slot, Button) call:
Gui gui = Gui.chest()
.button(Slot.of(1, 4), Button.of(ItemType.STONE))
.build();val gui = Gui.chest()
.button(Slot(1, 4), Button.of(ItemType.STONE))
.build()The method may also be called on a built Gui:
For more information relating to buttons, see Buttons.
Borders and Filling
border(Button) can be used to fill a border:
To fill the entire GUI, fill(Button) can be used:
Opening The GUI
To open a Gui, you need to first create a PaperVision:
Then you can open it:
Last updated
Was this helpful?