GeyserMenu Companion
GeyserMenu 堆栈的服务端部分。
通过 TCP 连接到 GeyserMenu Geyser 扩展,并提供一个简洁的 Java API
用于注册菜单按钮、发送原生 Bedrock 表单以及监听 Bedrock 玩家事件 ——
支持 Spigot/Paper 和 Velocity。
工作原理
一旦连接到 GeyserMenu 扩展,你的插件即可使用配套 API 注册
出现在 Bedrock 菜单中的按钮。当玩家点击按钮时,该事件会
转发到你插件的事件处理器。你也可以随时向任何 Bedrock 玩家直接发送表单。
特性
- 按钮注册 API — 注册带有图标、优先级和点击处理器的按钮
- 表单构建器 API — 向 Bedrock 玩家发送简单、模态和自定义表单
- 基于权限的可见性 — 根据玩家权限有条件地显示按钮
- Bedrock 玩家事件 — 监听 Bedrock 加入/离开事件,检查玩家是否为 Bedrock 玩家
- 多平台支持 — 从单一代码库同时支持 Spigot/Paper 和 Velocity
- 自动重连 — 断开连接时自动重新连接到 GeyserMenu 扩展
- 命令按钮 — 注册执行命令的按钮,无需编写点击处理器
要求
- Spigot/Paper 1.20.4+ 或 Velocity 3.3.0+
- Java 21+
- Floodgate
- GeyserMenu 扩展在 Geyser 上运行
安装
- 下载适合你平台的 JAR 文件 ——
Spigot 或 Velocity
- 将其放入
plugins/ 文件夹
- 启动服务器一次以生成
config.yml
- 设置
host、port 和 secret-key 以匹配你的 GeyserMenu 扩展配置
- 重启服务器 —— 插件将自动连接并同步按钮
配置
extension:
host: "localhost"
port: 19133
secret-key: "your-secret-key-here"
connection:
auto-reconnect: true
reconnect-delay: 5
server:
identifier: "lobby"
API 快速示例
GeyserMenuAPI api = GeyserMenuAPI.getInstance();
api.registerButton(MenuButton.builder()
.id("myplugin-main")
.text("My Plugin")
.imageUrl("https://example.com/icon.png")
.priority(50)
.onClick((player, session) -> openMenu((Player) player))
.build());
完整的 API 文档可在 GitHub 仓库 查看。
链接
GeyserMenu Companion
The server-side half of the GeyserMenu stack.
Connects to the GeyserMenu Geyser extension over TCP and exposes a clean Java API for
registering menu buttons, sending native Bedrock forms, and listening to Bedrock player events —
on both Spigot/Paper and Velocity.
How It Works
Once connected to the GeyserMenu extension, your plugins use the companion API to register
buttons that appear in the Bedrock menu. When a player clicks a button, the event is
forwarded to your plugin's handler. You can also send forms directly to any Bedrock player
at any time.
Features
- Button registration API — register buttons with icons, priorities, and click handlers
- Form builder API — send simple, modal, and custom forms to Bedrock players
- Permission-based visibility — conditionally show buttons based on player permissions
- Bedrock player events — listen for Bedrock join/leave, check if a player is Bedrock
- Multi-platform — supports Spigot/Paper and Velocity from a single codebase
- Auto-reconnect — automatically reconnects to the GeyserMenu extension on disconnect
- Command buttons — register buttons that execute commands without writing click handlers
Requirements
- Spigot/Paper 1.20.4+ or Velocity 3.3.0+
- Java 21+
- Floodgate
- GeyserMenu extension running on Geyser
Installation
- Download the JAR for your platform —
Spigot or Velocity
- Place it in your
plugins/ folder
- Start the server once to generate
config.yml
- Set the
host, port, and secret-key to match your GeyserMenu extension config
- Restart — the plugin will connect and sync buttons automatically
Configuration
extension:
host: "localhost"
port: 19133
secret-key: "your-secret-key-here"
connection:
auto-reconnect: true
reconnect-delay: 5
server:
identifier: "lobby"
Quick API Example
GeyserMenuAPI api = GeyserMenuAPI.getInstance();
api.registerButton(MenuButton.builder()
.id("myplugin-main")
.text("My Plugin")
.imageUrl("https://example.com/icon.png")
.priority(50)
.onClick((player, session) -> openMenu((Player) player))
.build());
Full API documentation is available on the GitHub repository.
Links
评论 0
登录后参与评分
还没有评论,来抢沙发吧