Skip to content

Buttons

WolfyScript edited this page Feb 20, 2022 · 12 revisions

Buttons are rendered as items into the inventory.
They can be configured to execute Actions on click, manipulate the ItemStack to render, and more.

Each button requires at least one ButtonState that contains the data to render it and run custom functions.
See ButtonStates for more info about how they work.

Buttons

There are a couple of different types of Buttons that you can use.

DummyButton

They just display an ItemStack without any action on click. They can call any of the Button Functions except the ButtonAction!

ActionButton

Those are the most customizable Buttons.
They can run actions when clicked, manipulate the ItemStack it renders, and more. See Button Functions to see what can be configured.

ToggleButton

This Button requires two ButtonStates that are static and won't change and will toggle between them each interaction.
Each state is handled the same as an ActionButton with all its functionality.

ChatInputButton

As the name suggests, the functionality is to prompt the player for chat input, receive it and use it.
The click will always be canceled so you won't be able to take out the item. The ButtonAction however can cancel the input prompt if they return false.

MultipleChoiceButton

The main use of this Button is when you need a Button with multiple states, that don't change, and you can go through it by clicking. Each state is handled the same as an ActionButton with all its functionality.

| Home

| GUIs

| NBT Tools

Clone this wiki locally