本模组旨在为数据包制作者提供工具,以创建能够反击的机器人。
与 Carpet 相比,这些机器人与原版客户端具有更高的同步性,例如自动跳跃和长矛攻击等功能均可正常工作。
与 Carpet Mod 及 Carpet PVP 不兼容
设置
通过 /herobot 命令查看和修改 HeRoBot 的设置。运行不带参数的 /herobot 将显示模组版本。
用法
/herobot <setting> - 显示当前值及描述
/herobot <setting> <value> - 在本次会话中临时设置该选项
/herobot <setting> <value> <perm> - 永久设置该选项(保存至配置文件)
机器人 (Bots)
allowSpawningOfflinePlayers
如果在在线模式下不存在指定名称的在线玩家,则在在线模式中生成离线玩家。
默认值:true
allowListingBotPlayers
允许机器人玩家在多人游戏玩家列表中显示。
默认值:true
botPingToTicks
更改机器人玩家的延迟到刻数的转换率。用于将机器人的延迟(毫秒)转换为击退的刻数延迟。
默认值:25
botLagAttacks
[实验性功能] 使对机器人玩家的左键点击(攻击)延迟等同于机器人的延迟值。
默认值:false
botLagUses
[实验性功能] 使对机器人玩家的右键点击(使用)延迟等同于机器人的延迟值。
默认值:false
botLeaveOnDeath
机器人玩家在死亡时断开与服务器的连接,而不是自动重生。
默认值:false
创造模式 (Creative)
creativeNoClip
创造模式穿墙模式。允许正在飞行的创造模式玩家穿过方块。
默认值:false
creativeFlySpeed
更改创造模式飞行速度乘数。数值越高,客户端飞行速度越快。
默认值:1.0
creativeFlyDrag
更改创造模式的空气阻力。数值越低,飞行时的空气阻力越小。
默认值:0.09
战斗 (Combat)
shieldStunning
启用盾牌眩晕效果,允许在盾牌失效后立即对实体造成伤害。
默认值:false
noProjectileRandom
移除投射物的随机性,使其完全精准。
默认值:false
爆炸 (Explosions)
explosionNoBlockDamage
控制爆炸是否会破坏方块。
取值:
FALSE - 原版行为
MOST - 影响非固体方块,但萤石和红石交互方块除外
TRUE - 防止所有方块损坏
默认值:FALSE
explosionNoFire
防止床和重生锚的爆炸产生火焰。
默认值:false
windChargeNoTrigger
风弹不会激活红石方块。
默认值:false
世界 / 杂项
clientsIgnoreSlowTickRate
如果为 false,将使客户端玩家忽略较慢的刻率(tick rate)。
默认值:true
editablePlayerNbt
允许直接编辑玩家 NBT 数据。启用后还允许通过 /ride 命令骑乘玩家。
默认值:false
xpNoCooldown
玩家立即吸收经验值,无延迟。
默认值:false
shulkerBoxAlwaysDrops
潜影盒将始终掉落物品,不受 doTileDrops 游戏规则的约束。
默认值:false
deleteChunkEntities
启用后,区块重置/删除也会删除这些区块内的实体数据文件。
默认值:false
rainThroughMovingPiston
允许雨水穿过由活塞移动的方块。
默认值:false
disableExperimentalScreen
移除实验性世界设置界面。如果在客户端设置,则禁用所有实验性屏幕;如果在世界设置中启用,则仅对该世界禁用。
默认值:false
Bot Player
Bot 玩家是加入服务器的假人,完全可以通过命令进行控制。它们通过 /playerspawn 生成,并使用 /player 命令进行控制。Bot 玩家在战斗、移动和使用物品方面具有正确的服务器端行为。
Bot 玩家在死亡时会自动复活,拥有满生命值、空背包且没有经验值(除非启用了 botLeaveOnDeath)。
/playerspawn
生成一个 Bot 玩家,可选参数包括位置、旋转角度、游戏模式和维度。
/playerspawn <name> - 在命令执行者的位置生成
/playerspawn <name> at <pos> - 在指定位置生成
/playerspawn <name> at <pos> facing <rotation> - 以特定的偏航角/俯仰角生成
/playerspawn <name> at <pos> facing <cardinal> - 面向基本方向生成(north、south、east、west、up、down)
/playerspawn <name> ... in <gamemode> - 以特定游戏模式生成(默认为创造模式)
/playerspawn <name> ... on <dimension> - 在指定维度生成
防止重复名称。尊重白名单和封禁列表。观察者模式生成时会飞行,生存模式生成时会站在地上。
/player
使用动作包控制机器人玩家。所有子命令均通过 /player <targets> ... 指定目标,并支持选择器以同时针对多个机器人。
use, attack, swing, jump, drop, dropStack, swapHands
使机器人执行玩家动作的操作命令。
/player <targets> <action> - 停止该动作
/player <targets> <action> once - 仅执行一次该动作
/player <targets> <action> continuous - 每刻(tick)持续执行该动作
/player <targets> <action> interval <ticks> - 每隔 N 刻执行一次该动作
不带参数的 use 会停止使用物品,而不会触发另一次使用(与 Carpet 中表现为 use once 的行为不同)。
swing 会挥动手臂而不执行任何操作,并重置攻击冷却时间。
对长矛/动能武器使用 attack 将执行刺击动作。
autojump
控制移动时自动跨越一格障碍物的行为。
/player <targets> autojump - 尝试单次自动跳跃(如果机器人正在移动且需要向上迈步,则进行跳跃)
/player <targets> autojump true - 启用持续自动跳跃
/player <targets> autojump false - 禁用持续自动跳跃
move
控制机器人的移动方向。
/player <targets> move - 停止所有移动
/player <targets> move forward - 向前移动
/player <targets> move backward - 向后移动
/player <targets> move left - 向左移动
/player <targets> move right - 向右移动
sneak / sprint
/player <targets> sneak - 开始潜行
/player <targets> unsneak - 停止潜行
/player <targets> sprint - 开始疾跑
/player <targets> unsprint - 停止疾跑
潜行会将移动速度降低至 30%。使用物品(非长矛)会将速度降低至 20%。
look
控制机器人的朝向。大多数朝向命令支持 delta <ticks> 以实现跨多刻的平滑过渡。
基本方向
/player <targets> look north|south|east|west|up|down
/player <targets> look north delta <ticks>
精确旋转
/player <targets> look <yaw> <pitch>
/player <targets> look <yaw> <pitch> delta <ticks>
相对转向
/player <targets> look left - 左转 90 度
/player <targets> look right - 右转 90 度
/player <targets> look back - 转身 180 度
/player <targets> look relative <rotation> - 按给定的相对旋转角度转向
- 以上均支持
delta <ticks>
注视位置
/player <targets> look at <pos>
/player <targets> look at <pos> delta <ticks>
注视实体
/player <targets> look upon <entity> - 注视实体的眼睛(默认)
/player <targets> look upon <entity> eyes - 注视实体的眼睛
/player <targets> look upon <entity> feet - 注视实体的脚部
/player <targets> look upon <entity> closest - 注视实体碰撞箱上最近的点
- 以上均支持
delta <ticks>
随机
/player <targets> look random - 看向随机方向
hotbar
选择快捷栏槽位。
/player <targets> hotbar <slot> - 选择第 1 至 9 号槽位
itemCd
控制物品冷却时间。
/player <targets> itemCd - 重置所有物品冷却时间(返回被重置的数量)
/player <targets> itemCd <item> - 显示剩余冷却刻数(返回刻数计数)
/player <targets> itemCd <item> reset - 重置该物品的冷却时间
/player <targets> itemCd <item> set - 应用该物品的默认冷却时间而不实际使用它
/player <targets> itemCd <item> set <ticks> - 应用自定义的冷却持续时间
ping
控制机器人的模拟延迟(Ping)。击退效果会根据 botPingToTicks 设置延迟相应的刻数。
/player <targets> ping - 显示机器人当前的 Ping 值及等效的刻数延迟
/player <targets> ping <value> - 设置 Ping 值(毫秒),建议值:0, 25, 50, 100, 150, 200
当 Ping 值不能被 botPingToTicks 整除时,刻数延迟会包含一定的随机性。例如,当 Ping 为 30 且 botPingToTicks 为 25 时,每刻有 5/25 的概率额外增加 1 刻延迟。
copycat
复制其他玩家的背包和动作包到机器人上。
/player <targets> copycat <source>
skin / handedness
切换机器人皮肤各部分的可见性。
皮肤部件:
/player <targets> skin cape - 披风
/player <targets> skin jacket - 夹克
/player <targets> skin leftSleeve - 左袖
/player <targets> skin rightSleeve - 右袖
/player <targets> skin leftPant - 左裤腿
/player <targets> skin rightPant - 右裤腿
/player <targets> skin hat - 帽子
每次调用都会切换对应部件的显示/隐藏状态。
左/右手习惯:
/player <targets> handedness left
/player <targets> handedness right
stop / kill / disconnect
/player <targets> stop - 停止所有动作和移动
/player <targets> kill - 杀死机器人(触发死亡和重生)
/player <targets> disconnect - 将机器人从服务器移除,不触发死亡
距离 (Distance)
测量两个位置、实体或碰撞框之间的距离,并将结果作为命令返回值存储(兼容计分板功能)。默认距离为球形(3D)距离。
from
使用精确位置计算点对点距离。
/distance from <pos> to <pos>
/distance from <pos> to <entity>
/distance from <entity> to <pos>
/distance from <entity> to <entity>
fromHitbox
使用源方块的完整包围盒而非其中心点。
/distance fromHitbox <block> to <pos|entity>
/distance fromHitbox <entity> to <pos|entity>
也可以与 toHitbox 组合使用:
/distance from <pos|entity> toHitbox <block>
/distance from <pos|entity> toHitbox <entity>
/distance fromHitbox <block|entity> toHitbox <block|entity>
e (指数缩放)
/distance ... e <exp>
- 在返回结果前,将距离乘以 10^exp
- 示例:4 个方块配合
e 3 返回 4000
horizontal
仅测量 XZ 平面距离(忽略 Y 轴)。
/distance ... horizontal
- 支持
e <exp>
vertical
仅测量 Y 轴距离(忽略 XZ 平面)。
/distance ... vertical
- 支持
e <exp>
延迟执行
调度命令或函数,使其在指定刻数延迟后运行。
tickDelay
调度命令或函数,使其在指定的刻数延迟后执行。
/delayed tickDelay <ticks> command <command> - 在延迟后运行命令,支持完整的自动补全
/delayed tickDelay <ticks> function <function> - 在延迟后运行数据包函数
queue
查看和管理待执行的延迟命令。
/delayed queue - 列出所有待执行的延迟命令
/delayed queue entity <entity> - 列出特定实体的延迟命令
/delayed queue entity - 列出执行命令者的延迟命令
/delayed queue remove <index> - 通过索引移除特定的延迟命令
clear
/delayed clear - 清除所有待执行的延迟命令
区块重置器
重置(删除)区块数据,使其在下一次加载时重新生成。已加载的区块会被跳过,必须先卸载。
chunk
按方块列位置重置特定的区块。
/chunk-resetter chunk <pos> - 重置给定位置的单个区块
/chunk-resetter chunk <from> <to> - 重置矩形范围内的所有区块(最多 256 个区块)
被重置区块中的实体将被丢弃。
world
重置整个维度中所有未加载的区块。同时删除 POI(兴趣点)数据。仅当启用 deleteChunkEntities 时才会删除实体数据文件。
/chunk-resetter world - 重置当前维度中的区块
/chunk-resetter world <dimension> - 重置指定维度中的区块
This mod is made for datapack makers to make bots that can fight back
The bots have a much higher parity with a vanilla client compared to carpet, with things like Auto-Jump and the spear working.
Incompatible With Carpet Mod and Carpet PVP
Settings
Views and modifies HeRoBot settings via the /herobot command. Running /herobot with no arguments displays the mod version.
Usage
/herobot <setting> - Displays the current value and description
/herobot <setting> <value> - Sets the setting temporarily for this session
/herobot <setting> <value> <perm> - Sets the setting permanently (saved to config)
Bots
allowSpawningOfflinePlayers
Spawn offline players in online mode if an online-mode player with the specified name does not exist.
Default: true
allowListingBotPlayers
Allows bot players to appear in the multiplayer player list.
Default: true
botPingToTicks
Changes the ping to tick conversion rate for bot players. Used when converting a bot's ping (in ms) to a tick delay for knockback.
Default: 25
botLagAttacks
[Experimental] Makes left clicks (attack) on bot players delayed by the bot's ping value.
Default: false
botLagUses
[Experimental] Makes right clicks (use) on bot players delayed by the bot's ping value.
Default: false
botLeaveOnDeath
Bot players disconnect from the server on death instead of automatically respawning.
Default: false
Creative
creativeNoClip
Creative no clip mode. Allows creative players who are flying to phase through blocks.
Default: false
creativeFlySpeed
Changes the creative flying speed multiplier. Higher values make the client fly faster.
Default: 1.0
creativeFlyDrag
Changes creative air drag. Lower values reduce air resistance while flying.
Default: 0.09
Combat
shieldStunning
Enables shield stunning, allowing entities to be damaged immediately after a shield is disabled.
Default: false
noProjectileRandom
Removes randomness from projectiles, making them perfectly accurate.
Default: false
Explosions
explosionNoBlockDamage
Controls whether explosions destroy blocks.
Values:
FALSE - vanilla behavior
MOST - affects non-solid blocks except glowstone and redstone-interaction blocks
TRUE - prevents all block damage
Default: FALSE
explosionNoFire
Prevents explosions from beds and respawn anchors from creating fire.
Default: false
windChargeNoTrigger
Wind charges won't activate redstone blocks.
Default: false
World / Misc
clientsIgnoreSlowTickRate
If false, makes client players ignore slower tick rates.
Default: true
editablePlayerNbt
Allows editing player NBT data directly. Also allows mounting players via /ride when enabled.
Default: false
xpNoCooldown
Players absorb experience instantly without delay.
Default: false
shulkerBoxAlwaysDrops
Shulker boxes will always drop, regardless of the doTileDrops gamerule.
Default: false
deleteChunkEntities
When enabled, chunk reset/deletion also deletes entity data files within those chunks.
Default: false
rainThroughMovingPiston
Allows rain to fall through blocks being moved by pistons.
Default: false
disableExperimentalScreen
Remove the experimental world setting. If set on the client, disables all experimental screens. If set on a world, only disables it for that world.
Default: false
Bot Player
Bot players are fake players that join the server and can be controlled entirely through commands. They are spawned with /playerspawn and controlled with /player. Bot players have correct server-side behavior for combat, movement, and item usage.
Bot players automatically respawn on death with full health, empty inventory, and no XP (unless botLeaveOnDeath is enabled).
/playerspawn
Spawns a bot player with optional position, rotation, gamemode, and dimension.
/playerspawn <name> - spawns at the executor's position
/playerspawn <name> at <pos> - spawns at a specific position
/playerspawn <name> at <pos> facing <rotation> - spawns with specific yaw/pitch
/playerspawn <name> at <pos> facing <cardinal> - spawns facing a cardinal direction (north, south, east, west, up, down)
/playerspawn <name> ... in <gamemode> - spawns in a specific gamemode (defaults to creative)
/playerspawn <name> ... on <dimension> - spawns in a specific dimension
Prevents duplicate names. Respects whitelist and bans. Spectators spawn flying, survival players spawn grounded.
/player
Controls bot players using action packs. All subcommands target with /player <targets> ... and support selectors for targeting multiple bots.
use, attack, swing, jump, drop, dropStack, swapHands
Action commands that make the bot perform player actions.
/player <targets> <action> - stops that action
/player <targets> <action> once - performs the action once
/player <targets> <action> continuous - performs the action every tick
/player <targets> <action> interval <ticks> - performs the action every N ticks
use without parameters stops using without triggering another use (unlike carpet where it behaved like use once).
swing swings a hand without performing an action and resets the attack cooldown.
attack with a spear/kinetic weapon will perform a stab action instead.
autojump
Controls automatic jumping over one-block obstacles while moving
/player <targets> autojump - attempts a single autojump (jumps if the bot is moving and would need to step up)
/player <targets> autojump true - enables continuous autojump
/player <targets> autojump false - disables continuous autojump
move
Controls bot movement direction.
/player <targets> move - stops all movement
/player <targets> move forward
/player <targets> move backward
/player <targets> move left
/player <targets> move right
sneak / sprint
/player <targets> sneak - starts sneaking
/player <targets> unsneak - stops sneaking
/player <targets> sprint - starts sprinting
/player <targets> unsprint - stops sprinting
Sneaking slows movement to 30% speed. Using an item (non-spear) slows to 20% speed.
look
Controls where the bot is looking. Most look commands support delta <ticks> for smooth transitions over multiple ticks.
Cardinal Directions
/player <targets> look north|south|east|west|up|down
/player <targets> look north delta <ticks>
Exact Rotation
/player <targets> look <yaw> <pitch>
/player <targets> look <yaw> <pitch> delta <ticks>
Relative Turns
/player <targets> look left - turns 90 degrees left
/player <targets> look right - turns 90 degrees right
/player <targets> look back - turns 180 degrees
/player <targets> look relative <rotation> - turns by the given relative rotation
- All support
delta <ticks>
Look at Position
/player <targets> look at <pos>
/player <targets> look at <pos> delta <ticks>
Look at Entity
/player <targets> look upon <entity> - looks at the entity's eyes (default)
/player <targets> look upon <entity> eyes - looks at the entity's eyes
/player <targets> look upon <entity> feet - looks at the entity's feet
/player <targets> look upon <entity> closest - looks at the closest point of the entity's hitbox
- All support
delta <ticks>
Random
/player <targets> look random - looks in a random direction
hotbar
Selects a hotbar slot.
/player <targets> hotbar <slot> - selects slot 1 through 9
itemCd
Controls item cooldowns.
/player <targets> itemCd - resets all item cooldowns (returns how many were reset)
/player <targets> itemCd <item> - shows remaining cooldown ticks (returns tick count)
/player <targets> itemCd <item> reset - resets the cooldown for that item
/player <targets> itemCd <item> set - applies the item's default cooldown without using it
/player <targets> itemCd <item> set <ticks> - applies a custom cooldown duration
ping
Controls the bot's simulated ping. Knockback is delayed by the equivalent number of ticks based on the botPingToTicks setting.
/player <targets> ping - shows the bot's current ping and equivalent tick delay
/player <targets> ping <value> - sets the ping in milliseconds (suggested: 0, 25, 50, 100, 150, 200)
The tick delay has some randomness when the ping doesn't divide evenly by botPingToTicks. For example, with ping 30 and botPingToTicks 25, there is a 5/25 chance each tick to add 1 extra tick of delay.
copycat
Copies another player's inventory and action pack onto the bot.
/player <targets> copycat <source>
skin / handedness
Toggles visibility of individual skin parts on the bot.
Skin parts:
/player <targets> skin cape
/player <targets> skin jacket
/player <targets> skin leftSleeve
/player <targets> skin rightSleeve
/player <targets> skin leftPant
/player <targets> skin rightPant
/player <targets> skin hat
Each call toggles the part on/off.
Left/Right Handedness:
/player <targets> handedness left
/player <targets> handedness right
stop / kill / disconnect
/player <targets> stop - stops all actions and movement
/player <targets> kill - kills the bot (triggers death and respawn)
/player <targets> disconnect - removes the bot from the server without a death
Distance
Measures distance between two positions, entities, or hitboxes and stores the result as the command return value (scoreboard-friendly). Default distance is spherical (3D).
from
Point-to-point distance using exact positions.
/distance from <pos> to <pos>
/distance from <pos> to <entity>
/distance from <entity> to <pos>
/distance from <entity> to <entity>
fromHitbox
Uses the full bounding box of the source instead of its center point.
/distance fromHitbox <block> to <pos|entity>
/distance fromHitbox <entity> to <pos|entity>
Can also be combined with toHitbox:
/distance from <pos|entity> toHitbox <block>
/distance from <pos|entity> toHitbox <entity>
/distance fromHitbox <block|entity> toHitbox <block|entity>
e (Exponent Scaling)
/distance ... e <exp>
- Multiplies the distance by 10^exp before returning
- Example: 4 blocks with
e 3 returns 4000
horizontal
Measures XZ distance only (ignores Y).
/distance ... horizontal
- Supports
e <exp>
vertical
Measures Y distance only (ignores XZ).
/distance ... vertical
- Supports
e <exp>
Delayed
Schedules commands or functions to run after a tick delay.
tickDelay
Schedules a command or function to execute after a specified number of ticks.
/delayed tickDelay <ticks> command <command> - runs a command after the delay, supports full auto-completion
/delayed tickDelay <ticks> function <function> - runs a datapack function after the delay
queue
View and manage pending delayed commands.
/delayed queue - lists all pending delayed commands
/delayed queue entity <entity> - lists delayed commands for a specific entity
/delayed queue entity - lists delayed commands for the executing entity
/delayed queue remove <index> - removes a specific delayed command by index
clear
/delayed clear - clears all pending delayed commands
Chunk Resetter
Resets (deletes) chunk data so they regenerate fresh on next load. Loaded chunks are skipped and must be unloaded first.
chunk
Resets specific chunks by block column position.
/chunk-resetter chunk <pos> - resets the single chunk at the given position
/chunk-resetter chunk <from> <to> - resets all chunks in the rectangular range (max 256 chunks)
Entities in reset chunks are discarded.
world
Resets all unloaded chunks in an entire dimension. Also deletes POI data. Entity data files are only deleted if deleteChunkEntities is enabled.
/chunk-resetter world - resets chunks in the current dimension
/chunk-resetter world <dimension> - resets chunks in the specified dimension
评论 0
登录后参与评分
还没有评论,来抢沙发吧