<button> element
An intractable button element.
Attributes
Attribute | Value | Description | Example |
---|---|---|---|
action | string | Action for the button to perform when clicked | action="cmd: tp %player% 0 100 0" |
action-trigger | string | Specifies whether left or right clicking triggers the action attribute."left" by default. | action-trigger="right" |
enabled | boolean | Disables / enables the button | enabled="false" |
Action attribute
Makes the button element to perform an action when clicked.
Action | Description | Example |
---|---|---|
close | Closes the menu | close |
cmd: <command> | Executes a command as console. You can use %player% as a placeholder for the player’s name | cmd: kill %player% |
player-cmd: <command> | Executes a command as the player. You can use %player% as a placeholder for the player’s name | player-cmd: balance |
Action triggers:
Value | Triggers |
---|---|
left | When the button is left-clicked (Punched) |
right | When the button is right-clicked (Interacted with) |
Default Styling
button {
$button-bg: #096cfe;
display: inline;
color: white;
background-color: $button-bg;
border-color: #121212;
padding: 0.5px;
border: 0.5px;
&:hover {
background-color: lighten($button-bg, 20%);
}
&:active {
background-color: darken($button-bg, 25%);
}
}
Examples
<button>Button text</button>
<button action="close">Close Menu</button>
<button action="cmd: kill %player%">Kill Self</button>
<button enabled="false" action="cmd: give %player% pumpkin_pie 64">Get some pumpkin pies :)</button>