SimpleNPC 是一款轻量但功能强大的 Paper 插件,为你的 Minecraft 服务器带来栩栩如生的玩家控制 NPC。生成外观如同真实玩家(史蒂夫皮肤)的 NPC,赋予它们工具和食物,看它们自主采矿、砍树、与怪物战斗、饥饿时进食,甚至夜间睡觉!它们会保护创造者,在受到攻击时以毁灭性的复仇做出反应,并通过机智的聊天消息让服务器充满生机。
✨ 特性
? 真实玩家外观 – NPC 佩戴史蒂夫头颅和皮革盔甲,与真实玩家完美融合。其名称标签实时显示生命值和饥饿度。
? 高级 AI 行为
采矿 – 给予镐子后,它们会自动搜索并破坏附近 5 格内的石头、矿石和深板岩。
伐木 – 给予斧头后,它们会砍倒所有类型的原木。
战斗 – 持有剑时,NPC 会与附近的怪物(僵尸、骷髅等)交战。
进食 – 当饥饿度下降时,它们会从物品栏中消耗食物,并伴有打嗝音效。
生命值恢复 – 如果饱食度充足(饥饿度 ≥ 18),它们会缓慢恢复生命值。
睡眠 – 到了夜晚,NPC 会寻找床并在黎明前“睡觉”。
随机漫步 – 空闲时,它们会像真实玩家一样四处游荡。
?️ 创造者保护 – 生成 NPC 的玩家永远不会被攻击,即使在复仇模式下也不例外。
⚡ 复仇模式 – 如果其他玩家攻击 NPC,它将进入 5 秒的复仇模式,并在下一次攻击时瞬间击杀该攻击者。
? 动作消息 – NPC 会通过彩色的聊天消息宣布它们正在做的事情(采矿、进食、睡眠等),每 5 秒重复一次以避免刷屏。
? 经济集成 – 使用 Vault 向没有 simplenpc.spawn 权限的玩家收费。你可在 config.yml 中设置自己的费用。
? 持久化数据 – 所有 NPC 及其物品栏内容都会保存到磁盘,并在服务器重启后恢复。
? 多种类型 – 可选择史蒂夫(对抗怪物)、僵尸(攻击玩家)或村民(与史蒂夫相同)——可轻松添加更多类型。
? 安装
从 Releases 页面下载最新的 SimpleNPC-*.jar。
将其放入服务器的 plugins 文件夹。
确保你的服务器运行的是 Paper 1.21+ 并已安装 Vault(以及如 EssentialsX 这样的经济插件)。
重启服务器。
首次启动后,会在 plugins/SimpleNPC/config.yml 处创建配置文件。
⚙️ 配置
yaml
为无权限玩家生成 NPC 的费用
spawn-cost: 100.0
NPC 执行自动操作(进食、生命恢复等)的频率(秒)
action-interval: 1
? 命令与权限
命令 描述 权限
/spawnnpc [type] [name] 在你所在位置生成一个 NPC。type 可以是 steve、zombie 或 villager(默认为 steve)。name 是可选的(默认为 "Steve")。 simplenpc.spawn(默认:op)
无权限 – 玩家从其 Vault 余额中支付配置的 spawn-cost。
有权限 – 免费生成。
? 使用方法
生成 NPC – 站在你想放置的位置,运行 /spawnnpc steve Bob。
给予物品 – 右键点击 NPC 打开其 27 格的物品栏。将工具(镐、斧、剑)或食物放入其中。
观察它工作 – NPC 现在将:
空闲时随机漫步。
手持镐子时挖掘石头/矿石。
手持斧头时砍树。
手持剑时攻击怪物(且不在复仇模式下)。
饥饿时食用食物。
夜间寻找床并“睡觉”。
测试复仇 – 让朋友击打 NPC。它将闪烁复仇模式,并在下一次攻击时瞬间击杀对方。
⚠️ 要求
Paper 1.21 或更高版本(Spigot 不完全兼容)。
Java 21 或更高版本。
Vault(必需 – 若无此插件则无法加载)。
如果你不需要经济功能,可以修改插件以软依赖 Vault(不建议用于生产环境)。
SimpleNPC is a lightweight yet powerful Paper plugin that brings lifelike player‑controlled NPCs to your Minecraft server. Spawn NPCs that look like real players (Steve skin), give them tools and food, and watch them autonomously mine ores, chop trees, fight monsters, eat when hungry, and even sleep at night! They protect their creator, react to attacks with devastating revenge, and keep the server alive with their witty chat messages.
✨ Features
? True Player Appearance – NPCs wear a Steve head and leather armor, blending perfectly with real players. Their name tag shows health and hunger in real time.
? Advanced AI Behaviors
Mining – Give them a pickaxe, and they’ll automatically search for and break nearby stone, ores, and deepslate (up to 5 blocks away).
Woodcutting – Hand them an axe, and they’ll chop down logs of all types.
Combat – With a sword, NPCs will engage nearby monsters (zombies, skeletons, etc.).
Eating – When hunger drops, they consume food from their inventory, complete with burp sounds.
Health Regeneration – If well‑fed (hunger ≥ 18), they slowly regenerate health.
Sleeping – At night, NPCs search for a bed and “sleep” until dawn.
Random Walking – When idle, they wander around like real players.
?️ Creator Protection – The player who spawned an NPC is never attacked, not even in revenge mode.
⚡ Revenge Mode – If another player attacks the NPC, it enters a 5‑second revenge mode and will instantly kill that attacker on its next hit.
? Action Messages – NPCs announce what they’re doing (mining, eating, sleeping, etc.) with colorful chat messages, repeated only every 5 seconds to avoid spam.
? Economy Integration – Uses Vault to charge players without the simplenpc.spawn permission. Set your own cost in config.yml.
? Persistent Data – All NPCs and their inventories are saved to disk and restored after a server restart.
? Multiple Types – Choose from steve (fights monsters), zombie (attacks players), or villager (same as steve) – more can be added easily.
? Installation
Download the latest SimpleNPC-*.jar from the Releases page.
Place it in your server’s plugins folder.
Ensure your server runs Paper 1.21+ and has Vault installed (with an economy plugin like EssentialsX).
Restart the server.
After first start, a configuration file is created at plugins/SimpleNPC/config.yml.
⚙️ Configuration
yaml
Cost to spawn an NPC for players without permission
spawn-cost: 100.0
How often (in seconds) NPCs perform automatic actions (eating, health regen, etc.)
action-interval: 1
? Commands & Permissions
Command Description Permission
/spawnnpc [type] [name] Spawns an NPC at your location. type can be steve, zombie, or villager (default steve). name is optional (default "Steve"). simplenpc.spawn (default: op)
Without permission – Players pay the configured spawn-cost from their Vault balance.
With permission – Free spawn.
? How to Use
Spawn an NPC – Stand where you want it and run /spawnnpc steve Bob.
Give it items – Right‑click the NPC to open its 27‑slot inventory. Place tools (pickaxe, axe, sword) or food inside.
Watch it work – The NPC will now:
Wander randomly when idle.
Mine stone/ores if holding a pickaxe.
Chop trees if holding an axe.
Attack monsters if holding a sword (and not in revenge mode).
Eat food when hungry.
Find a bed and “sleep” at night.
Testing revenge – Ask a friend to hit the NPC. It will flash revenge mode and instantly kill them on the next hit.
⚠️ Requirements
Paper 1.21 or higher (Spigot is not fully compatible).
Java 21 or higher.
Vault (mandatory – plugin will not load without it).
If you don’t need economy, you can modify the plugin to soft‑depend Vault (not recommended for production).
评论 0
登录后参与评分
还没有评论,来抢沙发吧