1.0.0
Compatibility
Required content
Changes
一个为 Paper 服务器开发的插件,添加了具有真实行为(挖掘、战斗、进食、睡觉)的类玩家 NPC!
✨ 功能特性
· 逼真的玩家 NPC – 使用自定义头颅和皮革盔甲生成看起来像真实玩家的 NPC(史蒂夫皮肤)。 · 自主行为 – NPC 会随机走动、挖矿、砍树、攻击怪物、吃东西,甚至晚上睡觉! · 工具使用 – 给它们镐、斧或剑,它们会自动使用最适合的工具。 · 饥饿与生命系统 – NPC 拥有生命值和饥饿值;它们会从背包中取食恢复饥饿,饱食度充足时生命会自动恢复。 · 反击模式 – 如果玩家攻击 NPC,它们会反击数秒。 · 睡觉 – 夜晚 NPC 会寻找附近的床并“睡觉”直到白天。 · 经济支持 – 集成 Vault;没有权限的玩家需要支付费用才能生成 NPC。 · 数据持久化 – NPC 及其物品栏会保存到文件,服务器重启后自动恢复。 · 多种类型 – 可选择 steve(攻击怪物)、zombie(攻击玩家)或 villager(行为同 steve)。
🔧 安装
- 从发布页下载最新 SimpleNPC-*.jar。
- 放入服务器的 plugins 文件夹。
- 确保服务器为 Paper 1.21+ 且已安装 Vault 及一个经济插件(如 EssentialsX)。
- 重启服务器。
📝 配置文件
首次运行后,会在 plugins/SimpleNPC/ 生成 config.yml:
# 无权限玩家生成 NPC 的费用
spawn-cost: 100.0
# NPC 自动行为执行间隔(秒,进食、生命恢复等)
action-interval: 1
🎮 指令与权限
指令 描述 权限 /spawnnpc [类型] [名称] 在当前位置生成一个 NPC。类型:steve、zombie、villager。名称可选。 simplenpc.spawn(默认 op)
· 无权限的玩家需从 Vault 经济中扣除 spawn-cost 设定的金额。
🧠 如何使用
- 生成 NPC – 站在目标位置,执行 /spawnnpc steve 张三。
- 给予物品 – 右键点击 NPC 打开其物品栏。放入工具(镐、斧、剑)或食物。
- 观察其工作 – NPC 会: · 空闲时随机走动。 · 持有镐时挖掘附近的石头/矿石。 · 持有斧时砍树。 · 持有剑时攻击附近的怪物(史蒂夫类型)或玩家(僵尸类型)。 · 饥饿时吃东西。 · 夜晚寻找床并“睡觉”。
- 反击 – 如果你攻击 NPC,它会反击你 5 秒。
⚠️ 依赖要求
· Paper 1.21 或更高版本(Spigot 可能不完全兼容)。 · Vault(可选,经济功能需要)。 · Java 21 或更高。
📦 依赖插件
· Vault(可选)
🐛 已知问题
· NPC 使用僵尸模型(为了行走动画),但僵尸声音已被禁用。 · 睡觉的 NPC 会站立不动并显示“💤”标签 – 受 Minecraft 限制,无法真正躺下。 · 工具耐久会消耗,但附魔(如耐久)暂未支持。
📜 许可证
MIT 许可证 – 可自由修改并在你的项目中使用。
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:r2i4JORh:mUbZVBoW"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:r2i4JORh:mUbZVBoW"
}

