-
Notifications
You must be signed in to change notification settings - Fork 0
Installation and Versions
Install the GatewaysJS build that matches your exact Minecraft loader and version. Gateways to Eternity and KubeJS are required at runtime. Their own required libraries must also be present.
请安装与 Minecraft 版本和加载器完全匹配的 GatewaysJS。运行时必须安装 Gateways to Eternity 与 KubeJS,同时也要安装它们各自要求的前置模组。
- Branch:
master - GatewaysJS:
1.6 - Minecraft:
1.20.1 - Forge:
47.x - Java:
17
该分支用于 Minecraft 1.20.1 Forge。Apotheosis 兼容为可选功能,只有调用对应 API 时才要求安装 Apotheosis。
- Branch:
codex/1.21.1-neoforge - GatewaysJS:
1.7-neoforge - Minecraft:
1.21.1 - NeoForge:
21.1.x - Java:
21
该分支用于 Minecraft 1.21.1 NeoForge,支持数据组件珍珠、Endless 网关和新版 Apotheosis Gateways 联动接口。
Put gateway registration scripts in:
脚本应放在:
# 服务端脚本目录
kubejs/server_scripts/
After editing a script, restart the server or run /reload. Always inspect logs/kubejs/server.log for script errors.
修改脚本后请重启服务端或执行 /reload,并检查 logs/kubejs/server.log 是否存在脚本错误。
Gateway.createPearlItem(id) is the recommended API on both versions, but its Java return type differs:
两个版本都推荐使用 Gateway.createPearlItem(id),但 Java 返回类型不同:
| Version | Return value | Meaning / 含义 |
|---|---|---|
| 1.20.1 | String |
Legacy item representation using gate NBT / 使用网关 NBT 的旧物品表示 |
| 1.21.1 | ItemStack |
A real stack with the Gateways data component / 带 Gateways 数据组件的真实物品栈 |
Use the API as the recipe output instead of manually constructing gate pearl NBT.
请直接把该 API 作为配方输出,不要手写旧版网关珍珠 NBT。
// 两个分支都推荐使用此写法
event.shapeless(Gateway.createPearlItem('kubejs:test_gate'), [
'minecraft:ender_pearl',
'minecraft:paper'
])GatewaysJS Wiki · English first, 中文同步说明 · GitHub