You can’t directly toggle fullscreen with a built-in “go full screen” action, but you can mimic Minecraft’s fullscreen keybind.
- Add or select your button in the layout editor.
- Right‑click it → Edit Action Script.
- Add a Mimic Keybind action.
- Set the value to:
(This presses the fullscreen keybind once.)key.fullscreen|||false|||0
That will trigger the same behavior as pressing F11, so the button switches Minecraft into/out of fullscreen. If you need it to hold the key for a moment, set keep_pressed_bool to true and set duration_ms (the third part) to the number of milliseconds you want it held.
More details are in the Action Scripts documentation under Mimic Keybind.