Simple Discord Rich Presence
Config:
KubeJS Integration: ( Introduced in version 3.0.0 of the mod )
Functions:
SDRP.setState( String message, String imageName, String imageKey )
message: message to show under the packname aka "In Overworld" or "In Nether", can be passed a string with the text to show or a lang key.
imageName: the text to show when hovering over the small image aka "Overworld" or "Nether", can be passed a string with the text to show or a lang key.
imageKey : the name Rich Present Art Asset to show, like loading, overworld, menu and so on.
SDRP.getCurrentState()
Gets the current state the client is set to.
Examples:
Update state on dimension change and joining world.
kubejs/startup_script/sdrp.js
onForgeEvent(
"net.minecraftforge.event.entity.EntityJoinWorldEvent",
(event) => {
if (event.getEntity().type === "entity.minecraft.player") {
if (event.getWorld().isClientSide()) {
const dimPath = event.getWorld().dimension().location().getPath();
SDRP.setState(`sdrp.${dimPath}.in`, `sdrp.${dimPath}`, "dimPath");
}
}
}
);
Image keys for if you are using your own Rich Presence Application. (Images used on the default Rich Presence Application can be found HERE)
logo
loading
menu
For dimensions, the key will be the registry name path of the dimension like:
overworld
the_nether
the_end
yamda_dim
For the message (stuff like "In Overworld") is done via lang keys "sdrp.<registry name path of the dimension>.in"
For imageName (stuff like "Overworld" when hovering over the small image) is done via lang keys "sdrp.<registry name path of the dimension>"
Lang keys can be modified and added via data packs and using mods like KubeJS