跳到正文

Simple Rich Discord Presence

简单的 Discord Rich Presence

收藏

介绍

介绍由机器翻译自 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”,可以传入要显示的文本字符串或语言键。
imageName: 鼠标悬停在小图标上时显示的文本,例如“Overworld”或“Nether”,可以传入要显示的文本字符串或语言键。
imageKey : 要显示的 Rich Presence 艺术资源名称,例如 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 应用,可使用以下图片键。(_默认 Rich Presence 应用中使用的图片可以在_ _这里_ _找到_)

logo
loading
menu

对于维度,图片键将使用该维度注册名的路径,例如:

overworld
the_nether
the_end
yamda_dim

消息(_例如“In Overworld”_)通过语言键 “_sdrp..in_” 设置。
imageName(_例如鼠标悬停在小图标上时显示的“Overworld”_)通过语言键 “_sdrp._” 设置。

可以通过数据包以及 KubeJS 等模组修改和添加语言键。

评论

登录后评论和评分

Nanite 的其他作品

查看全部 →