FakePlayers
适用于 Paper 的真实假玩家。 每个“机器人”都是一个没有连接客户端的真实服务器玩家。服务器会像对待其他普通加入者一样处理它:它会显示在标签页列表中,出现在 @a 和 Bukkit.getOnlinePlayers() 的结果中,受到伤害、死亡、重生,并保留自己的物品栏。
无需 Fabric,也无需服务端分支。将 jar 文件放入 plugins/ 目录即可完成安装。
✨ 功能特性
- 真实玩家,而非 NPC。 加入/离开、受伤、死亡以及命令事件都会像普通玩家一样触发。原版和插件命令对机器人同样有效:如
/give、/tp、/op、/gamemode 等。
- 真实的物理效果。 重力、碰撞、游泳、坠落伤害和击退效果都在每个 tick 在服务端进行模拟。
- 寻路系统。 内置 A* 算法,无需外部库。机器人可以走上方块、跳跃、下跳最多 3 格高度、绕过障碍物,并在卡住时重新规划路径。
- 类似真实客户端的行为。 攻击遵循攻击冷却时间。右键可以对方块、实体和物品生效(如进食、拉弓、放置方块)。机器人还可以跳跃、潜行和切换快捷栏槽位。
- 以机器人身份执行命令。
/fake cmd 会以机器人的权限运行任何命令。
- 皮肤支持。 如果存在同名的高级账号,其皮肤会通过 Mojang API 异步获取。否则,机器人将获得默认皮肤。
- 数据持久化。 机器人会被保存到
bots.yml 文件中,重启后重新生成。服务器会像对待普通玩家一样保留它们的物品栏和统计数据。
- 资源包支持。 机器人会自动接受服务器的资源包,因此所需的资源包不会让它们处于等待状态。
- 干净移除。 机器人会以正常断开连接的方式离开,无内存泄漏。在关闭服务器或执行
/reload 时,所有机器人都会被移除。
? 命令
所有命令都需要 fakeplayers.admin 权限(默认为 OP),并支持 Tab 补全。
| 命令 |
描述 |
/fake spawn <name> |
在你所在的位置生成一个机器人(从控制台执行时:在主世界的出生点) |
/fake remove <name|all> |
移除一个机器人 |
/fake list |
列出带有世界和坐标的机器人 |
/fake tp <name> |
将一个机器人传送到你身边 |
/fake follow <name> [player|stop] |
跟随一名玩家(默认为你) |
/fake goto <name> <x> <y> <z> |
走向指定点(~ 表示相对于机器人自身) |
/fake look <name> <player|x y z> |
看向某名玩家或某个点 |
/fake attack <name> [once|continuous|stop] |
攻击面前的实体 |
/fake use <name> [once|continuous|stop] |
使用手持物品右键 |
/fake jump <name> [once|continuous|stop] |
跳跃 |
/fake sneak <name> <on|off> |
潜行 |
/fake slot <name> <1-9> |
选择快捷栏槽位 |
/fake cmd <name> <command> |
以机器人身份运行命令 |
/fake chat <name> <message> |
以机器人身份发送聊天消息 |
⚙️ 配置
respawn-on-death: true # false = 机器人死亡时被移除
respawn-delay-ticks: 20
restore-on-startup: true
max-bots: 20
load-skins: true
show-join-quit-messages: true
? 兼容性
仅支持 Paper 1.21.11。该插件使用了服务端内部机制,因此不支持其他版本。
机器人经过正常的登录事件(AsyncPlayerPreLoginEvent 和 PlayerLoginEvent)。这使得 LuckPerms 等权限插件能够加载它们的数据。它还旨在与 SkinsRestorer 和 Multiverse-Core 良好配合。
机器人使用根据其名称生成的离线模式 UUID。
? 使用场景
AFK 农场与区块加载、测试插件和小游戏、调试权限以及服务器演示。
? 问题反馈
发现 Bug 或插件冲突?请提交 Issue 并附上你的服务器日志。
FakePlayers
Real fake players for Paper. Every bot is an actual server player with no client attached. The server treats it like anyone else who joined: it shows up in the tab list, @a and Bukkit.getOnlinePlayers(), takes damage, dies, respawns and keeps its own inventory.
No Fabric, no server fork. Drop the jar into plugins/ and you're done.
✨ Features
- Real players, not NPCs. Join/quit, damage, death and command events fire as they would for a normal player. Vanilla and plugin commands work on bots:
/give, /tp, /op, /gamemode, and so on.
- Real physics. Gravity, collisions, swimming, fall damage and knockback are all simulated server-side every tick.
- Pathfinding. Built-in A* with no external libraries. Bots step up blocks, jump, drop down up to 3 blocks, go around obstacles and re-path when stuck.
- Actions like a real client. Attacks respect the attack cooldown. Right-click works on blocks, entities and items (eating, bows, placing blocks). Bots can also jump, sneak and switch hotbar slots.
- Commands as the bot.
/fake cmd runs any command with the bot's own permissions.
- Skins. If a premium account with the same name exists, its skin is fetched from the Mojang API asynchronously. Otherwise the bot gets the default skin.
- Persistence. Bots are saved to
bots.yml and spawn again after a restart. The server keeps their inventory and stats like it does for any player.
- Resource packs. Bots accept server resource packs automatically, so a required pack won't leave them hanging.
- Clean removal. Bots leave like a normal disconnect, with no leaks. All bots are removed on shutdown and
/reload.
? Commands
All commands need fakeplayers.admin (op by default) and support tab completion.
| Command |
Description |
/fake spawn <name> |
Spawn a bot at your location (from the console: the main world's spawn) |
/fake remove <name|all> |
Remove a bot |
/fake list |
List bots with world and coordinates |
/fake tp <name> |
Teleport a bot to you |
/fake follow <name> [player|stop] |
Follow a player (you by default) |
/fake goto <name> <x> <y> <z> |
Walk to a point (~ is relative to the bot) |
/fake look <name> <player|x y z> |
Look at a player or a point |
/fake attack <name> [once|continuous|stop] |
Attack the entity in front |
/fake use <name> [once|continuous|stop] |
Right-click with the held item |
/fake jump <name> [once|continuous|stop] |
Jump |
/fake sneak <name> <on|off> |
Sneak |
/fake slot <name> <1-9> |
Select a hotbar slot |
/fake cmd <name> <command> |
Run a command as the bot |
/fake chat <name> <message> |
Send a chat message as the bot |
⚙️ Config
respawn-on-death: true # false = the bot is removed when it dies
respawn-delay-ticks: 20
restore-on-startup: true
max-bots: 20
load-skins: true
show-join-quit-messages: true
? Compatibility
Paper 1.21.11 only. The plugin uses server internals, so other versions are not supported.
Bots go through the regular login events (AsyncPlayerPreLoginEvent and PlayerLoginEvent). This lets permission plugins such as LuckPerms load their data. It is also designed to play well with SkinsRestorer and Multiverse-Core.
Bots use offline-mode UUIDs generated from their name.
? Use cases
AFK farms and chunk loading, testing plugins and minigames, debugging permissions, and server demos.
? Issues
Found a bug or a plugin conflict? Please open an issue and include your server log.
评论 0
登录后参与评分
还没有评论,来抢沙发吧