Wiki 9Minecraft Wiki 9Minecraft
Simple Discord Rich Presence Wiki › Guides › How to Set a Custom Discord Status from a KubeJS Script

How to Set a Custom Discord Status from a KubeJS Script

Why use the script hook

The config only covers the built-in states: main menu, loading, playing, and dimension. If you want the status to say something else — a custom message, a server name, a progress-style line — the mod exposes a KubeJS hook so you can push your own status text from a script instead of editing the config.

Writing the script

Create a script file in your KubeJS server_scripts or client_scripts folder, depending on where the hook is registered in your setup. Inside it, call the mod's exposed function and pass the string you want Discord to display. Keep the call inside an event or a tick handler if you want the text to update over time, rather than running once at load. Because the exact function name depends on the mod version, check the mod's own documentation or the example script it ships with before writing your call.

Testing it

Reload scripts with the KubeJS reload command rather than restarting the whole game where possible, then look at your Discord profile. If the status does not change, the script likely errored — check the KubeJS log output for the failing line. Remember the mod still controls the image; the script only changes the text unless you also point the config at your own application.