Carpet Bot Manager
Carpet Bot Manager 在 Fabric Carpet 的 /player 命令之上添加了由玩家拥有的机器人管理功能。它专为希望让 Carpet 机器人看起来像受控的玩家功能而非无限制的管理员工具的服务端设计。
玩家可以拥有编号的机器人,只能生成和控制自己拥有的机器人,并通过服务器配置的物品花费购买额外的机器人。操作员可以调整命名模式、初始机器人数量、价格以及每位玩家的机器人上限。
功能
- 由玩家拥有的 Carpet 机器人,具有持久化的按世界所有权
- 对 Carpet 的
/player 操作的安全 /cbot 命令封装
- 默认情况下每位玩家拥有一个初始机器人
- 可选的额外机器人购买系统
- 可配置的机器人价格、免费初始数量、机器人上限和机器人名称模式
/cbot list 中显示机器人的在线/离线状态
- 将机器人传送至所有者或指定坐标
- 转发常见的 Carpet 操作,如
use once(使用一次)、attack continuous(持续攻击)、move forward(向前移动)、stop(停止)、kill(杀死)、jump(跳跃)、sneak(潜行)等
- 当客户端和服务端都安装模组时,提供可选的客户端图形界面 (GUI)
- 服务端权威验证,确保玩家只能控制自己的机器人
依赖项
- Minecraft 1.21.11 或更高版本
- Fabric Loader
- Fabric API
- Fabric Carpet
Fabric Carpet 是生成机器人和转发机器人操作所必需的。如果缺少 Carpet,/cbot 命令仍会加载,但基于 Carpet 的操作会报告未安装 Carpet。
安装
仅用于命令模式时,请将模组安装在服务端。
若要使用图形界面,请在服务端和每个想要使用 GUI 的客户端上安装相同的模组 jar 文件。没有安装客户端模组的玩家仍然可以使用命令行界面。
玩家命令
/cbot list
/cbot buy
/cbot gui
/cbot <id> spawn
/cbot <id> tp
/cbot <id> tp <x> <y> <z>
/cbot <id> <carpet action...>
示例:
/cbot list
/cbot 1 spawn
/cbot 1 use once
/cbot 1 attack continuous
/cbot 1 move forward
/cbot 1 stop
/cbot 1 tp
/cbot 1 tp 100 64 -20
/cbot buy
客户端 GUI
运行 /cbot gui 或在 Minecraft 的控制菜单中绑定“Open Carpet Bot Manager”按键。
该 GUI 允许玩家:
- 查看已拥有的机器人及其在线状态
- 刷新机器人状态
- 在服务端策略允许的情况下购买另一个机器人
- 生成机器人
- 传送机器人
- 发送预设的 Carpet 操作
- 发送自定义的 Carpet 操作
管理员配置仅通过命令进行。
管理员配置
配置命令需要权限等级 4。
/cbot config show
/cbot config botname "<pattern>"
/cbot config starting-free <count>
/cbot config price <item> <count>
/cbot config cap <count>
/cbot config cap none
/cbot config reset
默认值:
- 机器人名称模式:
cbot_{player}_{id}
- 免费初始机器人数量:
1
- 购买价格:
1 minecraft:netherite_block
- 机器人上限:无
支持的机器人名称占位符:
生成的机器人名称经过清理并确定性地缩短,以符合 Minecraft 的 16 字符玩家名称限制。
安全模型
/cbot 在服务端授权下分发底层的机器人命令,但在验证玩家和机器人所有权之后才执行。玩家提供的是机器人 ID 而非原始机器人名称,服务端从玩家保存的所有权列表中解析该 ID。
模组仅针对解析出的拥有机器人分派受限命令:
player <ownedBotName> ...
tp <ownedBotName> ...
这使得服务端可以在不赋予玩家任意命令执行权限的情况下,暴露有用的 Carpet 机器人控制功能。
备注
更改机器人名称模式会立即重命名已保存的机器人身份。已经生成的使用旧名称的机器人可能需要手动杀死或重启。
Carpet Bot Manager
Carpet Bot Manager adds player-owned bot management on top of Fabric Carpet's /player command. It is built for servers that want Carpet bots to feel like a controlled player feature instead of an unrestricted admin tool.
Players get their own numbered bots, can spawn and control only the bots they own, and can buy additional bots using a server-configured item cost. Operators can tune the naming pattern, starter bot count, price, and per-player cap.
Features
- Player-owned Carpet bots with persistent per-world ownership
- Safe
/cbot command wrapper around Carpet's /player actions
- One starter bot by default for each player
- Optional buy system for additional bots
- Configurable bot price, free starter count, bot cap, and bot name pattern
- Bot online/offline status in
/cbot list
- Teleport bot to owner or to coordinates
- Forward common Carpet actions such as
use once, attack continuous, move forward, stop, kill, jump, sneak, and more
- Optional client GUI when the mod is installed on both client and server
- Server-authoritative validation so players can only control their own bots
Requirements
- Minecraft 1.21.11 or newer
- Fabric Loader
- Fabric API
- Fabric Carpet
Fabric Carpet is required for spawning bots and forwarding bot actions. If Carpet is missing, /cbot still loads, but Carpet-backed actions will report that Carpet is not installed.
Installation
For command-only use, install the mod on the server.
For the graphical interface, install the same mod jar on both the server and each client that wants to use the GUI. Players without the client mod can still use the command interface.
Player Commands
/cbot list
/cbot buy
/cbot gui
/cbot <id> spawn
/cbot <id> tp
/cbot <id> tp <x> <y> <z>
/cbot <id> <carpet action...>
Examples:
/cbot list
/cbot 1 spawn
/cbot 1 use once
/cbot 1 attack continuous
/cbot 1 move forward
/cbot 1 stop
/cbot 1 tp
/cbot 1 tp 100 64 -20
/cbot buy
Client GUI
Run /cbot gui or bind the Open Carpet Bot Manager key in Minecraft's controls menu.
The GUI lets players:
- See owned bots and online status
- Refresh bot state
- Buy another bot when allowed by server policy
- Spawn bots
- Teleport bots
- Send preset Carpet actions
- Send a custom Carpet action
Admin configuration remains command-only.
Admin Configuration
Configuration commands require permission level 4.
/cbot config show
/cbot config botname "<pattern>"
/cbot config starting-free <count>
/cbot config price <item> <count>
/cbot config cap <count>
/cbot config cap none
/cbot config reset
Defaults:
- Bot name pattern:
cbot_{player}_{id}
- Free starter bots:
1
- Buy price:
1 minecraft:netherite_block
- Bot cap: none
Supported bot name placeholders:
Generated bot names are sanitized and shortened deterministically to fit Minecraft's 16-character player name limit.
Security Model
/cbot dispatches the underlying bot commands with server authority, but only after validating the player and bot ownership. Players provide a bot ID, not a raw bot name, and the server resolves that ID from the player's saved ownership list.
The mod only dispatches restricted commands for the resolved owned bot:
player <ownedBotName> ...
tp <ownedBotName> ...
This allows servers to expose useful Carpet bot controls without giving players arbitrary command execution.
Notes
Changing the bot name pattern renames saved bot identities immediately. Already-spawned bots using old names may need to be killed or restarted manually.
评论 0
登录后参与评分
还没有评论,来抢沙发吧