FakePlayer
这是一个面向 Minecraft 1.20.x、1.21.x 及更高版本的服务器端插件,灵感来源于 Carpet-Mod。
点击此处观看演示视频。
功能特性
- 允许你生成在服务器看来与真实玩家无异的假人,它们可以保持区块加载
- 假人可以被原版命令和插件命令回收(移除),例如
/ban、/tp
- 你可以通过
/fp invsee 命令或右键点击假人来查看并编辑其物品栏
- 你可以完全控制它们的移动、跳跃、攻击……更好的是,还能设置周期性动作
- 每位假人均可配置独立的个人设置
依赖要求
配置文件
FakePlayer 仅会生成一个名为 config.tmpl.yml 的模板配置文件。
你需要将此文件重命名为 config.yml 作为你的实际配置文件。
这种方式可以在你升级插件时让你预览新增的配置项。
命令
| 命令 |
描述 |
权限 |
备注 |
| /fp spawn |
生成一个假人 |
fakeplayer.command.spawn |
|
| /fp kill |
杀死一个假人 |
fakeplayer.command.kill |
|
| /fp killall |
杀死服务器上所有的假人 |
OP |
|
| /fp select |
将某个假人设为默认 |
fakeplayer.command.select |
当玩家生成了超过 1 个假人时可用 |
| /fp selection |
查看已选中的假人 |
fakeplayer.command.selection |
仅当玩家生成了超过 1 个假人时可用 |
| /fp list |
列出已生成的假人 |
fakeplayer.command.list |
|
| /fp distance |
显示与某个假人的距离 |
fakeplayer.command.distance |
|
| /fp drop |
丢弃手中物品 |
fakeplayer.command.drop |
|
| /fp dropstack |
丢弃手中物品的整组 |
fakeplayer.command.dropstack |
|
| /fp dropinv |
丢弃背包中的所有物品 |
fakeplayer.command.dropinv |
|
| /fp skin |
从其他玩家复制皮肤 |
fakeplayer.command.skin |
若从离线玩家复制,有 60 秒冷却时间 |
| /fp invsee |
打开某个假人的背包 |
fakeplayer.command.invsee |
右键点击假人有相同效果 |
| /fp sleep |
睡觉 |
fakeplayer.command.sleep |
|
| /fp wakeup |
醒来 |
fakeplayer.command.wakeup |
|
| /fp status |
显示玩家状态 |
fakeplayer.command.status |
|
| /fp respawn |
重生已死亡的假人 |
fakeplayer.command.respawn |
当服务器配置未在假人死亡时将其踢出时可用 |
| /fp tp |
传送至某个假人 |
fakeplayer.command.tp |
|
| /fp tphere |
将某个假人传送到你身边 |
fakeplayer.command.tphere |
|
| /fp tps |
与该假人交换位置 |
fakeplayer.command.tps |
|
| /fp set |
更改某个假人的配置 |
fakeplayer.command.set |
|
| /fp config |
更改默认配置 |
fakeplayer.command.config |
|
| /fp expme |
将经验转移给你 |
fakeplayer.command.expme |
|
| /fp attack |
攻击 |
fakeplayer.command.attack |
|
| /fp mine |
挖矿/采集 |
fakeplayer.command.mine |
|
| /fp use |
使用/交互/放置 |
fakeplayer.command.use |
|
| /fp jump |
跳跃 |
fakeplayer.command.jump |
|
| /fp stop |
停止所有动作 |
fakeplayer.command.stop |
|
| /fp turn |
转身 |
fakeplayer.command.turn |
|
| /fp look |
注视指定位置 |
fakeplayer.command.look |
|
| /fp move |
移动 |
fakeplayer.command.mvoe |
|
| /fp ride |
骑乘 |
fakeplayer.command.ride |
|
| /fp sneak |
潜行 |
fakeplayer.command.sneak |
|
| /fp sprint |
疾跑 |
fakeplayer.command.sprint |
|
| /fp swap |
交换主手和副手物品 |
fakeplayer.command.swap |
|
| /fp hold |
手持对应快捷栏物品 |
fakeplayer.command.hold |
|
| /fp cmd | 执行命令 | fakeplayer.command.cmd | |
| /fp reload | 重新加载配置文件 | OP | |
个人配置
每位玩家都可以配置自己的设置,下次生成时将生效。
命令示例:
/fp config list - 查看所有个性化配置
/fp config set collidable false - 设置个性化配置
| 配置项 |
说明 |
| collidable |
是否启用碰撞箱 |
| invulnerable |
是否启用无敌模式 |
| wolverine |
是否启用超级治疗模式 |
| look_at_entity |
自动注视附近可攻击的目标(包括玩家),可与 attack 配合使用以自动战斗怪物 |
| pickup_items |
是否拾取物品 |
| skin |
是否使用你的皮肤 |
| replenish |
是否自动补给 |
| autofish |
是否自动钓鱼 |
权限
点击访问
每个命令都有各自的权限节点,但我们提供了一些权限包。
权限 fakeplayer.spawn
fakeplayer.spawn 包含以下权限:
- fakeplayer.command.spawn - 创建假人
- fakeplayer.command.kill - 杀死假人
- fakeplayer.command.list - 列出假人
- fakeplayer.command.distance - 查看距离
- fakeplayer.command.select - 选择假人
- fakeplayer.command.selection - 查看已选假人
- fakeplayer.command.drop - 掉落物品
- fakeplayer.command.dropstack - 掉落整组物品
- fakeplayer.command.dropinv - 掉落所有背包物品
- fakeplayer.command.skin - 复制皮肤
- fakeplayer.command.invsee - 查看背包
- fakeplayer.command.status - 查看状态
- fakeplayer.command.respawn - 重生假人
- fakeplayer.command.config - 设置默认设置
- fakeplayer.command.set - 设置假人参数
权限 fakeplayer.tp
fakeplayer.tp 包含以下权限:
- fakeplayer.command.tp
- fakeplayer.command.tphere
- fakeplayer.command.tps
权限 fakeplayer.action
fakeplayer.action 包含以下权限:
- fakeplayer.command.attack - 攻击
- fakeplayer.command.mine - 挖掘
- fakeplayer.command.use - 使用
- fakeplayer.command.jump - 跳跃
- fakeplayer.command.sneak - 潜行
- fakeplayer.command.sprint - 疾跑
- fakeplayer.command.look - 注视
- fakeplayer.command.turn - 转向
- fakeplayer.command.move - 移动
- fakeplayer.command.ride - 骑乘
- fakeplayer.command.swap - 交换主手和副手物品
- fakeplayer.command.sleep - 睡觉
- fakeplayer.command.wakeup - 起床
- fakeplayer.command.stop - 停止所有动作
- fakeplayer.command.hold - 切换快捷栏
- fakeplayer.config.replenish - 自动补给
- fakeplayer.config.replenish.chest - 在自动补给时可以从附近的箱子补给
- fakeplayer.config.autofish - 自动钓鱼
如果你的服务器不限制各种玩家命令,可以直接使用此权限。
fakeplayer.basic 包含所有安全权限,除了 /fp cmd 相关命令。
占位符变量
%fakeplayer_total%: 假人总数
%fakeplayer_creator%: 假人的创建者名称
%fakeplayer_actions: 假人的活跃动作,例如:USE|ATTACK
自定义翻译
- 在
plugins/fakeplayer 中创建 message 文件夹
- 将 此文件 复制到
message 文件夹
- 将文件重命名为
message_language_region.properties,例如 message_en_us.properties
- 编辑你的
config.yml,将 i18n.locale 设置为你刚才创建的后缀名,例如 en_us
- 输入
/fp reload-translation 重新加载翻译文件。如果你更改了 i18n.local,则应先执行 /fp reload
确保翻译文件的编码为 UTF-8
常见问题
xxx lost connection: PacketEvents 2.0 failed to inject
某些插件会修改假人的 Connection。你可以将 prevent-kicking 设置为 ALWAYS 来解决此问题。
# config.yml
prevent-kicking: ALWAYS
假人不吸引仇恨
默认情况下,假人处于无敌模式。玩家需要通过 /fp config set invulnerable false 手动关闭无敌模式以吸引仇恨。关闭后,他们将受到饥饿和健康效果的影响。你可能需要使用 res 或信标来确保假人的 hunger 和 health。
假人在一段时间后自动登出
这可能是由于像 AutheMe 这样的插件检测到假人长时间未登录。你可以在配置文件的 self-commands 中包含登录命令,以防止插件因闲置而踢出玩家:
# 注意:你应该使用复杂的密码,否则 AuthMe 可能会拒绝
self-commands:
- '/register abc123! abc123!'
- '/login abc123!'
FakePlayer
This is a server side plugin inspired by Carpet-Mod for Minecraft 1.20.x and 1.21.x and above.
Click me to visit a demo video.
Features
- Lets you spawn fake players who look like real to the server, they can keep chunk loading
- Fake players can be recolonized by vanilla commands and plugin commands, such as
/ban, /tp
- You can open and edit their inventory via
/fp invsee or Right-Clicking on them
- You can fully control their moving, jumping, attacking... What's better ? Make it periodical
- Each player can configure his personal configuration
Requirements
Config file
Fakeplayer only generates a template config file named config.tmpl.yml.
You need to rename this file to config.yml as your configuration file.
This approach can let you preview new content when you are upgrading it.
Commands
| Command |
Description |
Permission |
Note |
| /fp spawn |
Spawn a fake player |
fakeplayer.command.spawn |
|
| /fp kill |
Kill a fake player |
fakeplayer.command.kill |
|
| /fp killall |
Kill all fake players on the server |
OP |
|
| /fp select |
Select a fake player as default |
fakeplayer.command.select |
Available when player spawned more then 1 fake players |
| /fp selection |
View selected fake player |
fakeplayer.command.selection |
Available only when player spawned more then 1 fake players |
| /fp list |
List spawned fake players |
fakeplayer.command.list |
|
| /fp distance |
Show distance to a fake player |
fakeplayer.command.distance |
|
| /fp drop |
Drop held item |
fakeplayer.command.drop |
|
| /fp dropstack |
Drop entire stack of the held item |
fakeplayer.command.dropstack |
|
| /fp dropinv |
Drop all items in the inventory |
fakeplayer.command.dropinv |
|
| /fp skin |
Copy skin from another player |
fakeplayer.command.skin |
60 seconds cooldown if copy from a offline player |
| /fp invsee |
Open an inventory of a fake player |
fakeplayer.command.invsee |
Right-clicking on fake players has the same effect |
| /fp sleep |
Sleep |
fakeplayer.command.sleep |
|
| /fp wakeup |
Wake up |
fakeplayer.command.wakeup |
|
| /fp status |
Show player status |
fakeplayer.command.status |
|
| /fp respawn |
Respawn a dead fake player |
fakeplayer.command.respawn |
Available when server config does not kick on fake player death |
| /fp tp |
Teleport to a fake player |
fakeplayer.command.tp |
|
| /fp tphere |
Teleport a fake player to you |
fakeplayer.command.tphere |
|
| /fp tps |
Swap positions with fake player |
fakeplayer.command.tps |
|
| /fp set |
Change the configuration of a fake player |
fakeplayer.command.set |
|
| /fp config |
Change default configuration |
fakeplayer.command.config |
|
| /fp expme |
Transfer exp to you |
fakeplayer.command.expme |
|
| /fp attack |
Attack |
fakeplayer.command.attack |
|
| /fp mine |
Mine |
fakeplayer.command.mine |
|
| /fp use |
Use/Interact/Place |
fakeplayer.command.use |
|
| /fp jump |
Jump |
fakeplayer.command.jump |
|
| /fp stop |
Stop all actions |
fakeplayer.command.stop |
|
| /fp turn |
Turn around |
fakeplayer.command.turn |
|
| /fp look |
Look at specified location |
fakeplayer.command.look |
|
| /fp move |
Move |
fakeplayer.command.mvoe |
|
| /fp ride |
Ride |
fakeplayer.command.ride |
|
| /fp sneak |
Sneak |
fakeplayer.command.sneak |
|
| /fp sprint |
Sprinting |
fakeplayer.command.sprint |
|
| /fp swap |
Swap main and off-hand items |
fakeplayer.command.swap |
|
| /fp hold |
Hold corresponding hotbar item |
fakeplayer.command.hold |
|
| /fp cmd |
Execute command |
fakeplayer.command.cmd |
|
| /fp reload |
Reload config file |
OP |
|
Personal Configuration
Each player can configure his own configuration, it will take effect on the next spawning
Command examples:
/fp config list - View all personalized configurations
/fp config set collidable false - Set personalized configuration
| Configuration Item |
Note |
| collidable |
Whether collision box is enabled |
| invulnerable |
Whether invincible mode is enabled |
| wolverine |
Whether super heal mode is enabled |
| look_at_entity |
Automatically look at nearby attackable entities (including players), can be combined with attack to automatically fight monsters |
| pickup_items |
Whether to pick up items |
| skin |
Whether to use your skin |
| replenish |
Whether to auto-replenish |
| autofish |
Whether to autofish |
Permissions
Click to visit
Each command has its own permission node, but we provided some permissions packs
Permission fakeplayer.spawn
fakeplayer.spawn includes the following permissions:
- fakeplayer.command.spawn - Create fake player
- fakeplayer.command.kill - Kill fake player
- fakeplayer.command.list - List fake players
- fakeplayer.command.distance - View distance
- fakeplayer.command.select - Select fake player
- fakeplayer.command.selection - View selected fake player
- fakeplayer.command.drop - Drop an item
- fakeplayer.command.dropstack - Drop entire stack of items
- fakeplayer.command.dropinv - Drop all inventory items
- fakeplayer.command.skin - Copy skin
- fakeplayer.command.invsee - View inventory
- fakeplayer.command.status - View status
- fakeplayer.command.respawn - Respawn fake player
- fakeplayer.command.config - Set default settings
- fakeplayer.command.set - Set fake player settings
Permission fakeplayer.tp
fakeplayer.tp includes the following permissions:
- fakeplayer.command.tp
- fakeplayer.command.tphere
- fakeplayer.command.tps
Permission fakeplayer.action
fakeplayer.action includes the following permissions:
- fakeplayer.command.attack - Attack
- fakeplayer.command.mine - Mine
- fakeplayer.command.use - Use
- fakeplayer.command.jump - Jump
- fakeplayer.command.sneak - Sneak
- fakeplayer.command.sprint - Sprinting
- fakeplayer.command.look - Look
- fakeplayer.command.turn - Turn
- fakeplayer.command.move - Move
- fakeplayer.command.ride - Ride
- fakeplayer.command.swap - Swap main and off-hand items
- fakeplayer.command.sleep - Sleep
- fakeplayer.command.wakeup - Wake up
- fakeplayer.command.stop - Stop all actions
- fakeplayer.command.hold - Switch hotbar
- fakeplayer.config.replenish - Auto-replenish
- fakeplayer.config.replenish.chest - Can replenish from nearby chests when auto-replenishing
- fakeplayer.config.autofish - Autofish
If your server does not restrict various player commands, you can use this directly.
fakeplayer.basic includes all secure permissions, except for /fp cmd commands.
Placeholder Variables
%fakeplayer_total%: Total count of fake players
%fakeplayer_creator%: The creator name of a fake player
%fakeplayer_actions: Active actions of a fake player such as : USE|ATTACK
Custom Translation
- Create a
message folder in plugins/fakeplayer
- Copy this file to
message folder
- Rename the file to
message_language_region.properties such as message_en_us.properties
- Edit your
config.yml, set i18n.locale to the name suffix which you just created such as en_us
- Type
/fp reload-translation to reload translation file. If you change i18n.local, you should /fp reload first
Make sure the translation file is encoding with UTF-8
FAQs
xxx lost connection: PacketEvents 2.0 failed to inject
Some plugin change the Connection of the fake player, You can set prevent-kicking to ALWAYS to solve it.
# config.yml
prevent-kicking: ALWAYS
Fake players do not attract aggression
By default, fake players are in invincible mode. Players need to manually turn off invincible mode with /fp config set invulnerable false to attract aggression. After turning it off, they will
receive hunger and health effects. You may need to use res or beacon to ensure the fake player's hunger and health.
Fake players automatically log out after a while
This may be because plugins like AutheMe detect that fake players have not logged in for a long time. You can include the login command in the configuration file's self-commands to prevent the
plugin from kicking out players for being idle:
# Note: You should use a complex password, or AuthMe may reject it
self-commands:
- '/register abc123! abc123!'
- '/login abc123!'
评论 0
登录后参与评分
还没有评论,来抢沙发吧