InteractiveNPC
InteractiveNPC 是一款适用于 Paper 1.21.11 的插件,允许你使用 Minecraft 原生的模特人偶创建完全可定制且可交互的 NPC。
创建具有自定义名称、玩家皮肤、交互式对话、按钮以及传送、指令、消息、音效、粒子效果等动作的 NPC。
无需外部依赖,无需 NMS(原生 Minecraft 服务器代码),也无需重复任务。
✨ 功能特性
- ? 基于 Minecraft 原生模特人偶的 NPC
- ? 自定义玩家皮肤
- ? 原生 Minecraft 对话系统
- ? 交互式按钮
- ⚡ 每个按钮支持多个动作
- ? 传送功能
- ? 执行命令
- ? 发送玩家消息
- ? 播放音效
- ✨ 粒子效果
- ? 多轮对话导航
- ? 条件性按钮
- ? 基于等级的条件
- ? 基于物品的条件
- ? 基于世界的条件
- ?️ 基于权限的条件
- ⏱️ 延迟执行的动作
- ? 完全可通过 YAML 配置
- ?️ 游戏内 GUI 编辑器
- ? 无需重启即可重载配置
- ? 服务端交互验证
- ? 受保护的 NPC 指令
? 指令
所有指令均需 npc.admin 权限。
/npc create <id>
在你当前位置创建一个新的 NPC。
/npc create guide_pvp
ID 只能包含字母、数字、_ 或 -。
/npc edit <id>
打开 NPC 编辑器。
/npc edit guide_pvp
编辑器允许你修改:
- 名称
- 皮肤
- 对话
- 消息
- 按钮
- 动作
- 权限
- 位置
- 删除 NPC
/npc remove <id>
移除一个 NPC。
/npc remove guide_pvp
别名:
/npc delete <id>
关联的对话数据将保留。
/npc list
显示所有 NPC 并提供快捷传送和编辑按钮。
/npc list
/npc tp <id>
将你传送到某个 NPC 处。
/npc tp guide_pvp
/npc reload
无需重启服务器即可重新加载 NPC、对话和配置。
/npc reload
指令别名
该插件还提供:
/inpc
作为 /npc 的别名。
? 动作
每个按钮可以执行一个或多个动作。
动作可选地使用:
delay: 20
20 ticks = 1 秒。
command
执行一条命令。
- type: command
as: console
command: "tp %player% 100 65 100"
执行模式:
as: console
或:
as: player
message
向玩家发送一条消息。
- type: message
message: "§a欢迎 %player%!"
teleport
将玩家传送至配置好的位置。
sound
为玩家播放一段音效。
- type: sound
sound: ENTITY_PLAYER_LEVELUP
particle
显示粒子效果。
- type: particle
particle: HAPPY_VILLAGER
dialogue
打开另一个对话。
- type: dialogue
value: pvp_rules
返回上一个对话:
- type: dialogue
value: "@back"
close
关闭对话窗口。
- type: close
? 条件
按钮仅在满足特定条件时才显示。
所有条件均支持:
negate: true
用于反转条件判断。
权限条件
conditions:
- type: permission
permission: "server.vip"
只有拥有所需权限的玩家才能看到该按钮。
等级条件
检查玩家的等级。
conditions:
- type: level
min: 10
max: 50
物品条件
检查玩家是否持有特定物品。
conditions:
- type: item
material: DIAMOND
amount: 5
世界条件
限制按钮仅在特定世界中可用。
conditions:
- type: world
world: lobby
未满足条件时的处理
当条件未满足时,按钮可以选择隐藏:
when-unmet: hide
或禁用:
when-unmet: disable
? 对话示例
id: pvp_rules
title: "§bPvP 规则"
messages:
- "§7选择一条规则以了解更多:"
buttons:
- id: rule1
text: "§f1. 尊重其他玩家"
actions:
- type: dialogue
value: pvp_rule_1
- id: rule2
text: "§f2. 禁止使用的装备"
actions:
- type: dialogue
value: pvp_rule_2
- id: back
text: "§e← 返回"
actions:
- type: dialogue
value: "@back"
? NPC 示例
id: guide_pvp
name: "§ePvP 向导"
subtitle: "§7右键进行交互"
skin: "Notch"
dialogue: pvp_intro
location:
world: "lobby"
x: 120.5
y: 65
z: -32.5
yaw: 90
pitch: 0
interaction:
sound: ENTITY_VILLAGER_TRADE
particle: HAPPY_VILLAGER
? 占位符
以下占位符可用于消息和命令中:
%player%
%player_uuid%
%world%
%x%
%y%
%z%
%npc_id%
%npc_name%
%npc_x%
%npc_y%
%npc_z%
示例:
message: "§a欢迎 %player% 来到大厅!"
? 权限
npc.admin
授予以下访问权限:
- 所有
/npc 指令
- NPC 编辑器
- NPC 管理
- 编辑器交互
默认设置:
op
?️ 安全性
InteractiveNPC 包含多项内置保护措施:
- 安全的 NPC 指令
- 危险命令黑名单
- 占位符清理
- 默认控制台执行
- 权限检查
- 服务端条件验证
- 按钮可用性验证
- 对话会话验证
- NPC 距离验证
当区块加载时,NPC 模特人偶会根据其 YAML 配置自动重建。
⚙️ 配置
NPC 存储在:
plugins/InteractiveNPC/npcs/
对话存储在:
plugins/InteractiveNPC/dialogues/
修改后,只需运行:
/npc reload
即可应用更改而无需重启服务器。
? 适用场景
InteractiveNPC 非常适合:
- ? 服务器大厅
- ? 小游戏服务器
- ⚔️ PvP 服务器
- ?️ 冒险地图
- ? 剧情驱动地图
- ? RPG 服务器
- ? 教程 NPC
- ? 传送 NPC
- ? 交互式对话系统
使用 InteractiveNPC,将简单的 Minecraft 人体模型变成强大、可交互且完全可配置的 NPC。
InteractiveNPC
InteractiveNPC is a Paper 1.21.11 plugin that allows you to create fully customizable and interactive NPCs using Minecraft's native mannequins.
Create NPCs with custom names, player skins, interactive dialogues, buttons, and actions such as teleportation, commands, messages, sounds, particles, and more.
No external dependencies, no NMS, and no repetitive tasks required.
✨ Features
- ? NPCs based on Minecraft's native mannequins
- ? Custom player skins
- ? Native Minecraft dialogues
- ? Interactive buttons
- ⚡ Multiple actions per button
- ? Teleportation
- ? Command execution
- ? Player messages
- ? Sounds
- ✨ Particles
- ? Multiple dialogue navigation
- ? Conditional buttons
- ? Level-based conditions
- ? Item-based conditions
- ? World-based conditions
- ?️ Permission-based conditions
- ⏱️ Delayed actions
- ? Fully YAML-configurable
- ?️ In-game GUI editor
- ? Reload configuration without restarting
- ? Server-side interaction validation
- ? Protected NPC commands
? Commands
All commands require the npc.admin permission.
/npc create <id>
Creates a new NPC at your current location.
/npc create guide_pvp
The ID can only contain letters, numbers, _ or -.
/npc edit <id>
Opens the NPC editor.
/npc edit guide_pvp
The editor allows you to modify:
- Name
- Skin
- Dialogue
- Messages
- Buttons
- Actions
- Permissions
- Location
- NPC deletion
/npc remove <id>
Removes an NPC.
/npc remove guide_pvp
Alias:
/npc delete <id>
The associated dialogue is preserved.
/npc list
Displays all NPCs and provides quick Teleport and Edit buttons.
/npc list
/npc tp <id>
Teleports you to an NPC.
/npc tp guide_pvp
/npc reload
Reloads NPCs, dialogues and configuration without restarting the server.
/npc reload
Command Alias
The plugin also provides:
/inpc
as an alias for /npc.
? Actions
Each button can execute one or multiple actions.
Actions can optionally use:
delay: 20
20 ticks = 1 second.
command
Executes a command.
- type: command
as: console
command: "tp %player% 100 65 100"
Execution modes:
as: console
or:
as: player
message
Sends a message to the player.
- type: message
message: "§aWelcome %player%!"
teleport
Teleports the player to a configured location.
sound
Plays a sound for the player.
- type: sound
sound: ENTITY_PLAYER_LEVELUP
particle
Displays particles.
- type: particle
particle: HAPPY_VILLAGER
dialogue
Opens another dialogue.
- type: dialogue
value: pvp_rules
Return to the previous dialogue:
- type: dialogue
value: "@back"
close
Closes the dialogue.
- type: close
? Conditions
Buttons can be displayed only when specific conditions are met.
All conditions support:
negate: true
to invert the condition.
Permission Condition
conditions:
- type: permission
permission: "server.vip"
The button will only be available to players with the required permission.
Level Condition
Checks the player's level.
conditions:
- type: level
min: 10
max: 50
Item Condition
Checks whether the player has a specific item.
conditions:
- type: item
material: DIAMOND
amount: 5
World Condition
Restricts a button to a specific world.
conditions:
- type: world
world: lobby
Unmet Conditions
When a condition is not met, the button can either be hidden:
when-unmet: hide
or disabled:
when-unmet: disable
? Dialogue Example
id: pvp_rules
title: "§bPvP Rules"
messages:
- "§7Choose a rule to learn more:"
buttons:
- id: rule1
text: "§f1. Respect other players"
actions:
- type: dialogue
value: pvp_rule_1
- id: rule2
text: "§f2. Prohibited equipment"
actions:
- type: dialogue
value: pvp_rule_2
- id: back
text: "§e← Back"
actions:
- type: dialogue
value: "@back"
? NPC Example
id: guide_pvp
name: "§ePvP Guide"
subtitle: "§7Right-click to interact"
skin: "Notch"
dialogue: pvp_intro
location:
world: "lobby"
x: 120.5
y: 65
z: -32.5
yaw: 90
pitch: 0
interaction:
sound: ENTITY_VILLAGER_TRADE
particle: HAPPY_VILLAGER
? Placeholders
The following placeholders can be used in messages and commands:
%player%
%player_uuid%
%world%
%x%
%y%
%z%
%npc_id%
%npc_name%
%npc_x%
%npc_y%
%npc_z%
Example:
message: "§aWelcome %player% to the lobby!"
? Permissions
npc.admin
Grants access to:
- All
/npc commands
- NPC editor
- NPC management
- Editor interactions
Default:
op
?️ Security
InteractiveNPC includes several built-in protections:
- Secure NPC commands
- Dangerous command blacklist
- Sanitized placeholders
- Console execution by default
- Permission checks
- Server-side condition validation
- Button availability validation
- Dialogue session validation
- NPC distance validation
NPC mannequins are automatically recreated from their YAML configuration when their chunks are loaded.
⚙️ Configuration
NPCs are stored in:
plugins/InteractiveNPC/npcs/
Dialogues are stored in:
plugins/InteractiveNPC/dialogues/
After making changes, simply run:
/npc reload
to apply them without restarting your server.
? Perfect For
InteractiveNPC is ideal for:
- ? Server lobbies
- ? Minigame servers
- ⚔️ PvP servers
- ?️ Adventure maps
- ? Story-driven maps
- ? RPG servers
- ? Tutorial NPCs
- ? Teleportation NPCs
- ? Interactive dialogue systems
Turn simple Minecraft mannequins into powerful, interactive and fully configurable NPCs with InteractiveNPC.
评论 0
登录后参与评分
还没有评论,来抢沙发吧