Yes. You can use a Switch Case placeholder in the Image element’s resource source.
For example, assuming your option is pauseOnLostFocus:
{"placeholder":"switch_case","values":{"value":"{"placeholder":"minecraft_option_value","values":{"name":"pauseOnLostFocus"}}","cases":"true:/config/fancymenu/assets/pause_on.png,false:/config/fancymenu/assets/pause_off.png","default":"/config/fancymenu/assets/pause_off.png"}}
Setup
- Put both images in:
/config/fancymenu/assets/
- Right-click the Image element and open its source settings.
- Set the source type to Local.
- Use Open in Editor for the source field.
- Paste the placeholder above.
- Replace:
pauseOnLostFocus with your option name
pause_on.png with your enabled image
pause_off.png with your disabled image
The placeholder checks whether the option returns true or false and selects the corresponding image.
FancyMenu placeholders are JSON-like, so the nested placeholder should not have its quotes escaped. Resource sources support placeholders and should update when the value changes. 🖼️
If the image does not refresh immediately after clicking your toggle button, add an Update Screen action after changing the option.