Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

UltiBot

Java 8UltiTools-APIPaper 1.21.1

假人模块 / Fake Player Module

基于 NMS 的假人模块,可以在服务器上生成和控制假人玩家。假人拥有真实玩家的完整行为能力,包括移动、交互、挖矿、战斗、聊天等。支持动作循环、宏录制/回放和自定义皮肤。

NMS-based fake player module for spawning and controlling server-side bots. Bots are real ServerPlayer instances with full player behavior — movement, interaction, mining, combat, chat, and more. Supports repeating actions, macro record/playback, and custom skins.

架构 / Architecture

UltiBot 采用多模块 Maven 结构,将 API 接口与 NMS 实现分离:

UltiBot uses a multi-module Maven architecture that separates API interfaces from NMS implementation:

模块 / Module说明 / Description
ultibot-api纯接口定义(BotPlayer, NMSBridge, ActionType)/ Pure interfaces
ultibot-coreUltiTools 模块(服务、命令、配置、事件)/ UltiTools module (services, commands, config, events)
ultibot-v1_21_R1Paper 1.21.1 NMS 实现 / NMS implementation for Paper 1.21.1
ultibot-dist打包为最终 shaded JAR / Shaded distribution JAR

功能 / Features

功能Feature说明
假人生成Bot Spawning基于 NMS 的真实 ServerPlayer,完整加入服务器生命周期
移动控制Movement传送、行走、跳跃、蹲下、疾跑、视角转向
战斗与交互Combat & Interaction攻击、挖矿、使用物品、交互实体
循环动作Repeating Actions10 种动作类型,可设定间隔 tick 数自动循环
宏录制Macro System录制/回放/管理动作序列
自定义皮肤Custom Skins从 Mojang API 获取玩家皮肤应用到假人
聊天与命令Chat & Commands假人可发送聊天消息和执行命令
自动管理Auto Management主人下线自动移除、死亡自动重生
区块加载Chunk Loading可选让假人保持区块加载
前缀标识Bot PrefixTab 列表和聊天中显示可配置前缀
消息捕获Message Capture通过 Netty 拦截假人收到的聊天消息,用于测试验证
GUI 交互GUI Interaction假人可点击物品栏槽位、查看/关闭 GUI,用于测试插件界面
OP 切换OP Toggle动态切换假人 OP 状态,无需修改 ops.json

动作类型 / Action Types

/bot action <name> <action> <interval> 支持以下动作:

动作Action说明
JUMPJump跳跃
SNEAKSneak蹲下
SPRINTSprint疾跑
USEUse Item使用手持物品
ATTACKAttack攻击(空挥)
MINEMine挖矿(需朝向方块)
DROP_ITEMDrop Item丢弃单个物品
DROP_STACKDrop Stack丢弃整组物品
DROP_INVENTORYDrop Inventory丢弃整个背包
LOOK_AT_NEARESTLook at Nearest看向最近实体

命令 / Commands

基础命令 / Basic Commands

命令权限说明
/bot spawn <name>ultibot.use在当前位置生成假人 / Spawn bot at your location
/bot spawnat <name>ultibot.use在控制台指定位置生成假人 / Spawn bot at specified location (console)
/bot remove <name>ultibot.use移除指定假人 / Remove a bot
/bot remove allultibot.use移除所有假人 / Remove all bots
/bot listultibot.use列出所有假人 / List all bots
/bot tp <name>ultibot.use传送假人到你的位置 / Teleport bot to you
/bot reloadultibot.admin重载配置 / Reload config

动作命令 / Action Commands

命令权限说明
/bot action <name> <action> <interval>ultibot.action开始循环动作 / Start repeating action
/bot stop <name>ultibot.action停止所有动作 / Stop all actions

工具命令 / Utility Commands

命令权限说明
/bot chat <name> <message>ultibot.use让假人发送聊天消息 / Make bot chat
/bot cmd <name> <command>ultibot.use让假人执行命令 / Make bot run command
/bot skin <name> <skinName>ultibot.use更换假人皮肤 / Change bot skin

测试命令 / Testing Commands

命令权限说明
/bot messages <name>ultibot.use查看假人收到的聊天消息 / View bot's received messages
/bot clearmsg <name>ultibot.use清空假人消息记录 / Clear bot's message history
/bot op <name>ultibot.admin给予假人 OP 权限 / Grant bot OP status
/bot deop <name>ultibot.admin移除假人 OP 权限 / Remove bot OP status
/bot click <name> <slot>ultibot.use让假人点击物品栏槽位 / Make bot click inventory slot
/bot inv <name>ultibot.use查看假人当前打开的 GUI / View bot's open inventory
/bot closeinv <name>ultibot.use关闭假人当前 GUI / Close bot's open inventory

宏命令 / Macro Commands

命令权限说明
/bot macro record <name> <macroName>ultibot.use开始录制宏 / Start recording macro
/bot macro stop <name>ultibot.use停止录制 / Stop recording
/bot macro play <name> <macroName>ultibot.use回放宏 / Play macro
/bot macro listultibot.use列出所有宏 / List all macros

配置 / Configuration

# config.yml# Maximum bots each player can spawn / 每个玩家最多生成的假人数max-bots-per-player: 5# Server-wide bot limit / 服务器假人总数限制max-total-bots: 20# Default skin name for bots / 假人默认皮肤default-skin: Steve# Enable bot ticking for physics / 启用假人物理 ticktick-bots: true# Allow bots to keep chunks loaded / 允许假人保持区块加载allow-chunk-loading: false# Prefix shown in chat/tab for bots / 假人聊天和Tab列表前缀bot-prefix: "[Bot] "# Remove bots when owner disconnects / 主人断开时自动移除假人auto-remove-on-quit: true# Auto-respawn bots after death / 假人死亡后自动重生auto-respawn: true

权限 / Permissions

权限说明
ultibot.use基础假人命令(生成、移除、列表、传送、聊天、命令、皮肤、宏)
ultibot.action动作循环命令
ultibot.admin管理命令(重载配置)

支持版本 / Supported Versions

  • Paper 1.21.1 (NMS v1_21_R1)

NMS 实现按版本分离,添加新版本只需新建 ultibot-v<version> 模块实现 NMSBridge 接口。

NMS implementations are version-isolated. To add a new MC version, create a new ultibot-v<version> module implementing the NMSBridge interface.

BotPlayer API

BotPlayer 接口提供 27 个方法,分为以下几类:

The BotPlayer interface provides 27 methods in the following categories:

类别 / Category方法 / Methods
生命周期 / Lifecyclejoin(), disconnect(), tick(), respawn()
移动 / MovementmoveTo(), setMovement(), jump(), setSneaking(), setSprinting(), lookAt()
交互 / Interactionattack(), mine(), useItem(), interactEntity(), swapHands()
聊天 / Chatchat(), performCommand()
物品 / ItemsdropItem(), dropInventory(), selectSlot()
状态 / StateisOnGround(), isUsingItem()
测试支持 / TestinggetReceivedMessages(), clearMessages(), setOp(), isOp(), clickSlot(), getOpenInventoryView(), closeInventory()

UltiTools-API Features Used

  • @ConfigEntity / @ConfigEntry / @Range / @NotEmpty config validation
  • @CmdExecutor / @CmdMapping / @CmdParam command system
  • UltiToolsPlugin.i18n() bilingual translations (Chinese/English)
  • @Service + constructor injection (IoC)
  • @UltiToolsModule plugin registration

致谢 / Acknowledgments

本项目的架构设计和 NMS 实现参考了以下开源项目:

The architecture and NMS implementation of this project were inspired by the following open-source projects:

  • tanyaofei/minecraft-fakeplayer — 多模块 Maven 架构(-api, -core, -v1_21_R1, -dist)、NMSBridge 版本抽象接口、ActionType 动作枚举、ActionTicker 循环动作模式、BotPlayer API 设计(移动轴 zza/xxa、物理 tick 等)均参考自该项目。/ Multi-module Maven architecture, NMSBridge version abstraction interface, ActionType enum, ActionTicker repeating action pattern, and BotPlayer API design (movement axes, physics tick) were referenced from this project.

  • KP56/Fake-Players-Spigot-PluginFakeConnection 使用 Netty EmbeddedChannel 模拟假网络连接的核心技术方案、以及假人加入服务器的完整生命周期(GameProfileServerPlayer → 假连接 → 玩家列表注册)参考自该项目。/ The FakeConnection pattern using Netty EmbeddedChannel to simulate a fake network connection, and the full join lifecycle (GameProfile → ServerPlayer → fake connection → player list registration) were referenced from this project.

构建 / Build

cd Modules/UltiBot
mvn clean package

最终 JAR: ultibot-dist/target/UltiBot-1.0.0.jar

测试 / Testing

cd Modules/UltiBot
mvn test

130 tests, 81.9% instruction coverage (JaCoCo).

About

Fake player bot module for UltiTools-API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages