Components
All visual and interactive elements are defined in the items:
section.
Simple forms only have buttons, so it is assumed every component type is a button.
Custom form components have a required type:
. For example type: dropdown
.
You can arrange components in any order you like using the layout:
map, lowest number at the top.
Available Component Types
All simple form components are just buttons and do not need a type. The following table lists the available types for custom forms.
Type | Description |
---|---|
button | Buttons used in simple forms |
dropdown | Dropdown menu with custom options |
input | Input field for custom text entry |
toggle | True or false toggle switch |
slider | Number slider with set range |
step-slider | Button with options e.g. Low, Med, High |
Form Behavior & Rendering
- The
layout:
controls vertical arrangement - Components listed under the same order key will only display one based on condition logic (whichever is met from top to bottom).
- A simple form will only run the commands under the button you clicked on
- Custom forms will run the commands under every component if the submit button is pressed, otherwise will run none.
Custom forms will save the input values outputted into session data. Example:
- If your component is
inp0
, use%commandpanels_session_inp0%
to access its value.
Component Configuration
Each component has its own configuration schema.
Button Component
Button that can execute commands with Command Actions. icon-type is set to PATH by default if not included, icon-texture is used for a texture path or url.
type: 'button'
name: 'Click Me'
icon-type: PATH / URL
item-texture: 'texture/url/path'
Dropdown Component
Dropdown menu with custom options to choose from.
type: 'dropdown'
name: 'Choose a choice'
options:
- 'Survival'
- 'Creative'
- 'Spectator'
Input Component
Text input entry box.
type: 'input'
name: 'Text above the input box'
placeholder: 'Greyed out text behind input box'
default: 'Text already in the input'
...etc
Toggle Component
Text input box, default value is the value it is set to before it is opened.
type: 'toggle'
name: 'Choose true or false'
default: 'false'
Slider Component
Dropdown menu with choices. Min is minimum value, Max is maximum value, step is how much to change the number by every time the slider is moved, default is what it starts off with when the panel is opened.
type: 'slider'
name: 'Name above slider'
min: 1
max: 10
step: 1
default: 1
Step Slider Component
Slider input for number ranges.
type: 'step-slider'
name: 'Name above step-slider'
default: Medium
steps:
- Low
- Medium
- High