Simple Rich Discord Presence

Simple Rich Discord Presence - Simple Rich Discord Presence(简易 Discord 丰富状态)

简单的 Discord Rich Presence
fabric / forge / neoforge 作者 Sunekaer 支持版本 1.14.4 - 26.1
下载量
4,331,340
关注数
70
数据来源
Modrinth
模组详细介绍

Simple Discord Rich Presence

配置:

clientId: "你的 Discord 应用 ID"

enable: "如果你想禁用 Discord Rich Presence,将其设为 false。"

screenEvent: "如果设为 false,将禁用内置的 screenEvent,它用于判断我们何时位于主菜单。"

clientJoinEvent: "如果设为 false,将禁用内置的 clientJoinEvent,它用于判断玩家何时正在加入世界以及切换维度。"

KubeJS 集成

函数:

SDRP.setState( String message, String imageName, String imageKey )

message: 显示在整合包名称下方的消息,也就是类似 “In Overworld” 或 “In Nether” 的内容;可以传入要显示的字符串或 lang key。

imageName: 鼠标悬停在小图片上时显示的文本,也就是类似 “Overworld” 或 “Nether” 的内容;可以传入要显示的字符串或 lang key。

imageKey : 要显示的 Rich Present Art Asset 名称,例如 loading、overworld、menu 等。

SDRP.getCurrentState()

获取客户端当前被设置的状态。

示例:

在维度切换和加入世界时更新状态。

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");

}

}

}

);

如果你使用的是你自己的 Rich Presence Application,可用的图片键如下。(默认 Rich Presence Application 使用的图片可在 HERE) 找到

logo

loading

menu

对于维度,键将是该维度的 registry name path,例如:

overworld

the_nether

the_end

yamda_dim

对于消息(类似 “In Overworld” 的内容),通过 lang key "sdrp..in" 实现。

对于 imageName(鼠标悬停在小图片上时显示的类似 “Overworld” 的内容),通过 lang key "sdrp." 实现。

lang key 可以通过数据包以及使用 KubeJS 之类的模组进行修改和添加。

基本信息
模组名称Simple Rich Discord Presence
作者Sunekaer
下载量4,331,340
关注数70
支持版本1.14.4 - 26.1
加载器fabric / forge / neoforge
客户端required
服务端unsupported