To make a brightness slider, follow the same pattern as the FOV slider but target the gamma option instead:
- Add a Slider element.
- Set Slider Type to Decimal Range with minimum
0.0and maximum1.0. - Set Pre-Selected Value to
{"placeholder":"minecraft_option_value","values":{"name":"gamma"}}so it starts at the current brightness. - Edit the slider’s Action Script:
- Add the Set Minecraft Option action (
edit_minecraft_option). - Set its value to
gamma:$$valueso it writes the slider’s value back to thegammaoption every time the slider changes.
- Add the Set Minecraft Option action (
If you want the label to show a percentage, use something like:
Brightness: {"placeholder":"calc","values":{"decimal":"false","expression":"{"placeholder":"minecraft_option_value","values":{"name":"gamma"}} * 100"}}%
That shows the current brightness in % and updates automatically.
You can find more detail in the Set/Get Minecraft Options guide.