InputEngine
一个无缝的跨平台桥梁,将来自 Minecraft 客户端的自定义按键捕获并传输至服务器!
? 概述
InputEngine 是一款强大的实用模组/插件,旨在捕获来自 Minecraft 客户端的自定义按键,并将其即时传输到服务器。它允许服务器端的插件对客户端自定义键位(例如:技能 1、闪避、打开自定义菜单)做出无缝响应。
该项目充当一个两部分的桥梁:客户端模组(Fabric/NeoForge)和 服务器插件(Spigot/Paper)。
✨ 功能
- ? 客户端键位绑定:在客户端注册自定义键位。完全支持 Fabric 和 NeoForge。
- ⚡ 网络桥梁:每当按下或释放绑定的按键时,向服务器发送高效、轻量级的数据包。
- ? 兼容原版服务器:客户端的网络通道是可选的。你可以安全地保留模组安装,同时在加入原版服务器时不会被踢出!
- ?️ 服务器端 API:暴露了一个自定义 Spigot 事件 (
PlayerKeyPressEvent),以便开发者让服务器端插件轻松监听并对玩家输入做出反应。
? 安装
InputEngine 需要同时安装服务器端插件和客户端模组才能正常工作。
对于玩家(客户端)
- 下载适用于你加载器的正确版本(Fabric 或 NeoForge)。
- 将下载的
.jar 文件放入你的 Minecraft 客户端的 mods/ 文件夹中。
- Fabric 用户: 确保已安装 Fabric API。
对于服务器管理员(插件)
- 下载 Spigot 发布文件。
- 将其放入你的 Spigot/Paper 服务器的
plugins/ 文件夹中。
- 重启服务器。
? 对于开发者(API 使用)
如果你正在开发 Bukkit/Spigot 插件并希望响应玩家的按键操作,你可以轻松地使用 API!
监听 PlayerKeyPressEvent:
import dev.darkblade.mod.input_engine.server.api.PlayerKeyPressEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class MyPluginListener implements Listener {
@EventHandler
public void onPlayerKeyPress(PlayerKeyPressEvent event) {
if (event.isPressed()) {
event.getPlayer().sendMessage("You pressed: " + event.getAction().name());
} else {
event.getPlayer().sendMessage("You released: " + event.getAction().name());
}
}
}
完整示例见 示例插件 和 API 文档
? 许可证
本项目为开源项目,遵循 MIT License 许可协议。
InputEngine
A seamless cross-platform bridge capturing custom keystrokes from the Minecraft client to the server!
? Overview
InputEngine is a powerful utility mod/plugin designed to capture custom keystrokes from the Minecraft client and transmit them instantly to the server. It allows server-side plugins to react seamlessly to custom client-side keybinds (e.g., Skill 1, Dodge, Open Custom Menu).
This project acts as a two-part bridge: a Client Mod (Fabric/NeoForge) and a Server Plugin (Spigot/Paper).
✨ Features
- ? Client-Side Keybinding: Registers custom keybinds on the client. Fully supports both Fabric and NeoForge.
- ⚡ Network Bridge: Sends efficient, lightweight payloads to the server whenever a bound key is pressed or released.
- ? Vanilla Server Compatible: The networking channel is optional on the client. You can safely keep the mod installed while joining vanilla servers without being disconnected!
- ?️ Server-Side API: Exposes a custom Spigot Event (
PlayerKeyPressEvent) for developers so your server-side plugins can easily listen and react to player inputs.
? Installation
InputEngine requires both a server-side plugin and a client-side mod to function correctly.
For Players (Client)
- Download the correct version for your mod loader (Fabric or NeoForge).
- Place the downloaded
.jar file into your Minecraft client's mods/ folder.
- Fabric Users: Ensure you have the Fabric API installed.
For Server Owners (Plugin)
- Download the Spigot release file.
- Place it in your Spigot/Paper server's
plugins/ folder.
- Restart your server.
? For Developers (API Usage)
If you are developing a Bukkit/Spigot plugin and want to react to a player's key press, you can easily use the API!
Listen to the PlayerKeyPressEvent:
import dev.darkblade.mod.input_engine.server.api.PlayerKeyPressEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class MyPluginListener implements Listener {
@EventHandler
public void onPlayerKeyPress(PlayerKeyPressEvent event) {
if (event.isPressed()) {
event.getPlayer().sendMessage("You pressed: " + event.getAction().name());
} else {
event.getPlayer().sendMessage("You released: " + event.getAction().name());
}
}
}
Full example are in the Example plugin and API Documentation
? License
This project is open-source and available under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧