Buttons, Colors and Keybinds
Learn about the button, color and keybind elements that can be used in a config.
Buttons
Common button
The button is a simple interaction that can trigger code when pressed. It's got both single and dual-column variants.
You can create your method to run when the button is pressed using the Runnable interface:
![](https://docs.polyfrost.org/~gitbook/image?url=https%3A%2F%2F3056662043-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVPLa0wt84LweTZoNVj4Z%252Fuploads%252Fp6ThmpXlzxfSHGCQy2Pw%252Fimage.png%3Falt%3Dmedia%26token%3D62b0f1b0-52db-4fd0-928d-942f88b6d76a&width=768&dpr=4&quality=100&sign=f2aab189&sv=1)
Keybinds
OneConfig also offers keybinds that replace Minecraft's own keybind system. Basically, it's handled and stored by OneConfig, not the game. It's got both single and dual-column variants.
This config component uses OneKeyBind to store the keybinds.
To register an action when a keybind is activated, add the following to your constructor:
![](https://docs.polyfrost.org/~gitbook/image?url=https%3A%2F%2F3056662043-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVPLa0wt84LweTZoNVj4Z%252Fuploads%252FhhMy8kGxtwqBpJZUrBmw%252Fimage.png%3Falt%3Dmedia%26token%3Dda534bfd-e214-4ca9-be80-6a84e250b3b6&width=768&dpr=4&quality=100&sign=bfc1c7ba&sv=1)
Colors
The color option lets the user change any default color to their own, using a built-in color picker.
This config component uses OneColor to store the colors.
![](https://docs.polyfrost.org/~gitbook/image?url=https%3A%2F%2F3056662043-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVPLa0wt84LweTZoNVj4Z%252Fuploads%252F2LtHOZWHvEWJ3ZbAsL4Z%252Fimage.png%3Falt%3Dmedia%26token%3D2c7aadc4-037c-4fd1-8c60-a1e6c4a9c7fb&width=768&dpr=4&quality=100&sign=1017fbb3&sv=1)
![](https://docs.polyfrost.org/~gitbook/image?url=https%3A%2F%2F3056662043-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVPLa0wt84LweTZoNVj4Z%252Fuploads%252FTOLE7pfeiKzGIUfclAUH%252Fimage.png%3Falt%3Dmedia%26token%3Db1fd7697-01f2-48fb-895a-9965014f3e7e&width=768&dpr=4&quality=100&sign=d609e4be&sv=1)
Last updated