- Contributors
- Idea by benni76
- Supported Minecraft Versions
- 1.18
- 1.19
- 1.20
Introduction
This resource allows you to add pressable buttons to Minecraft, you can run any code when a button is pressed. It uses the offhand swap button but everyone will see their own key binds in the text.
Requires skript-reflect and SkBee
Usage
There are 2 steps, placing our button and making it execute some code.Step 1. Use the /givebuttonblock <id> [item type] [display text] command. <> = required and [] = optional
If you are setting the display text, you can use the _key placeholder to show the player their bind. Also, keep in mind that the display text uses MiniMessage rather than legacy colors. Click here to learn more.
Then, place the button anywhere you want. You can place multiple buttons with the same ID.
Step 2. Create a function for your button that takes a player and a location.
Code:
function button_myButton(p: player, l: location):
broadcast "%{_p}% pressed button 'myButton'"
Then we add player and location parameters for the player who pressed the button and the location of the button.
You can join our discord server here to get support.
If you would like to be notified about the updates, please download Update Checker Core.
If you would like to be notified about the updates, please download Update Checker Core.