EIZZOs-NPCs
基于数据包的非玩家角色(NPC)系统,具备智能移动、分支对话、战斗机制以及按玩家独立的状态追踪功能。
? 特性
? 高级 NPC 系统
- 基于数据包的渲染 - 使用网络包在客户端渲染 NPC(而非服务器实体)
- 按玩家独立状态 - 每个玩家拥有独立的 NPC 生命值、位置和对话进度
- 35+ 可配置属性 - 自定义从追踪范围到奖励的所有内容
- 可视化编辑器 GUI - 游戏内 NPC 管理,支持通过聊天命令编辑属性
? 对话系统
- 分支对话 - 多节点对话树,带有可点击的选择项
- 动作序列 - 对话中可包含消息、音效、等待、传送和奖励
- 一次性令牌 - 安全的选项验证防止命令滥用
- 单次对话模式 - 按玩家记录已查看的节点,跳过已看过的内容
⚔️ 战斗与追踪
- 三种追踪模式 - NONE(静态)、STILL(仅旋转)、FOLLOW(寻路跟随)
- 敌对 NPC - 攻击范围内玩家的 NPC,武器伤害随装备缩放
- 智能寻路 - 穿越障碍物、跳跃方块、避免碰撞
- 按玩家独立生命值 - 一名玩家击杀 NPC 不会影响其他玩家
? 自定义
- 完整皮肤支持 - 支持 Mojang API(用户名)或通过 Mineskin 上传 PNG 文件
- 装备系统 - 盔甲和手持物品,支持完整的 NBT 数据
- 音效 - 每个 NPC 可自定义交互音效
- 调试可视化 - 粒子网格显示追踪范围
? 奖励集成
- Vault 经济 - 击杀 NPC 时给予金钱奖励
- EIZZOs-Tokens - 发放自定义代币(软依赖)
- 奖励上限 - 可选的按玩家领取上限
- 自定义消息 - 可配置的奖励通知消息
? 命令
| 命令 |
权限 |
描述 |
/npc |
eizzo.npcs.admin |
打开 NPC 列表 GUI |
/npc help |
- |
显示帮助菜单 |
/npc debug |
eizzo.npcs.admin |
切换调试粒子(8 方块立方体可视化) |
/npc create <id> <name> |
eizzo.npcs.admin |
在你所在位置创建新 NPC |
/npc list |
eizzo.npcs.admin |
打开 NPC 列表 GUI |
/npc delete <id> |
eizzo.npcs.admin |
永久删除 NPC |
/npc set <id> <property> <value> |
eizzo.npcs.admin |
设置 NPC 属性(见下文) |
/npc tp <id> [world x y z yaw pitch] |
eizzo.npcs.admin |
将 NPC 传送至你的位置或指定坐标 |
/npc addcmd <id> <command> |
eizzo.npcs.admin |
添加交互命令/动作 |
/npc clearcmds <id> |
eizzo.npcs.admin |
清除 NPC 的所有命令 |
/npc dialog <id> <node> [token] [player] |
Admin/Token |
执行对话节点(控制台使用需指定 player 参数) |
NPC 设置属性
| 属性 |
类型 |
描述 |
name |
String |
显示名称(支持 MiniMessage) |
type |
EntityType |
生物类型(VILLAGER, ZOMBIE, SKELETON, PLAYER 等) |
skin |
String |
玩家用户名或 skins/ 文件夹中的 PNG 文件名 |
trackingmode |
NONE/STILL/FOLLOW |
追踪行为 |
trackingrange |
Double |
检测范围(以方块为单位) |
hostile |
true/false |
是否攻击范围内的玩家 |
cape |
true/false |
PLAYER 类型的 NPC 是否显示披风 |
collision |
true/false |
玩家能否与该 NPC 发生碰撞 |
npccollision |
true/false |
NPC 之间是否相互碰撞 |
flying |
true/false |
无重力,3D 移动 |
returntospawn |
true/false |
玩家离开范围后返回出生点 |
nametag |
true/false |
名字标签可见性 |
sound |
Sound key 或 "none" |
交互时的音效(例如 ui.button.click) |
godmode |
true/false |
无敌模式 |
respawndelay |
Integer |
死亡后重生前的刻数(20 = 1 秒) |
runmode |
op/console/player |
命令执行模式 |
location |
world x y z yaw pitch |
手动设置位置 |
? 权限
| 权限 |
描述 |
eizzo.npcs.admin |
完全访问所有 NPC 命令和编辑器 GUI |
注意: 除 /npc help 外的所有命令都需要管理员权限。执行对话需要有效的会话令牌 或 管理员权限。
?️ 配置
主配置文件 (config.yml)
config-version: 1.1
tracking:
max-range: 50.0 # 服务端剔除范围(立方体)
database:
type: "sqlite" # "sqlite" 或 "mysql"
host: "localhost"
port: 3306
database: "minecraft"
username: "root"
password: ""
pool-size: 10 # 仅限 MySQL
logging:
dialogue-to-console: true # 记录对话执行日志
rewards:
enabled: true
max-amount: 1000.0 # 每次击杀的最大奖励金额
use-vault: true # 启用 Vault 经济
use-eizzos-tokens: false # 启用 EIZZOs-Tokens
vault-message: "<green>+ ${amount} <gray>(NPC Kill)"
token-message: "<gold>+ {amount} {currency} <gray>(NPC Kill)"
数据库
- 默认: SQLite 位于
plugins/EIZZOs-NPCs/npcs.db
- 可选: 通过 HikariCP 连接池支持 MySQL
- 数据表:
npcs, npc_commands, npc_dialogues, npc_equipment, player_seen_nodes, player_reward_counts
? 交互机制
玩家交互
- 左键点击(攻击): 如果 NPC 不在 GodMode,则造成伤害;施加击退和受伤动画
- 右键点击(交互): 触发对话或命令
- 潜行 + 右键点击(管理员): 打开 NPC 编辑器 GUI
战斗系统
武器伤害缩放:
- 基础:剑 (6), 斧头 (7), 镐子 (4), 铲子 (3), 锄头 (2), 拳头 (1)
- 材质加成:下界合金 +2, 钻石 +1.5, 铁 +1.0, 石头 +0.5
- 暴击: 下落攻击(非在地面上)造成 1.5 倍伤害
敌对模式:
- NPC 会追逐并攻击追踪范围内的玩家
- 每对玩家-NPC 组合有 1 秒的攻击冷却时间
- 对被攻击的玩家施加击退效果
- 忽略创造模式/旁观者模式的玩家
? 对话系统
对话动作
动作按顺序执行,在对话节点中每行一个:
| 动作 |
格式 |
描述 |
[msg] |
[msg] Hello %player%! |
发送格式化 NPC 消息 |
[wait] |
[wait] 2.5 |
暂停对话 N 秒 |
[sound] |
[sound] entity.villager.ambient |
播放音效 |
[choice] |
[choice] Option1=next_node | Option2=another |
显示可点击按钮(生成令牌) |
[listen] |
[listen] [world] x y z |
等待玩家移动到指定方块 |
[reward] |
[reward] |
给予玩家 Vault/Token 奖励 |
[home] |
[home] world x y z yaw pitch |
传送 NPC 到指定位置 |
[jump] |
[jump] |
施加向上速度(1.6 方块/刻) |
[set] |
[set] property1=value; property2=value |
覆盖该玩家的 NPC 属性 |
一次性对话模式
启用后,会记录每个玩家已查看的节点:
- 自动跳转到下一个未查看的
start 节点(start, start1, start2 等)
- 如果所有节点都已查看,则回退到标准命令
- 存储在
player_seen_nodes 数据库表中
令牌安全
- 每个
[choice] 生成随机的 6 位十六进制令牌
- 令牌仅限一次使用,并在被选择后过期
- 防止手动
/npc dialog 命令滥用
- 管理员绕过令牌验证(但仍需要令牌字段)
? 移动与物理
追踪模式
| 模式 |
行为 |
NONE |
NPC 不追踪;停留在出生点 |
STILL |
旋转头部面向玩家但不移动 |
FOLLOW |
寻路朝向玩家并避免碰撞 |
物理常量
- 重力: 1.0 方块/刻(真实下落)
- 移动速度: 0.4 方块/刻(普通),0.6 方块/刻(敌对)
- 停止距离: 2.5 方块(普通),1.5 方块(敌对)
- 跳跃高度: 1.1 方块(自动跳过 ≤1 方块高的障碍物)
- 台阶高度: 0.6 方块(无需跳跃即可登上平台)
碰撞系统
- 玩家碰撞: 如果
collidable=true,NPC 会将玩家推开
- NPC 间碰撞: 仅当两个 NPC 都可见且
npcCollision=true 时发生
- 障碍物规避: 绕过实心方块导航
- 旁观者免疫: 旁观模式下的玩家不会触发追踪/碰撞
? 皮肤系统
玩家皮肤
/npc set <id> skin Notch
- 从 Mojang API 获取:用户名 → UUID → 纹理属性
- 备用方案:如果 Mojang 失败,则使用 MC-Heads API
- 异步后台处理(非阻塞)
自定义 PNG 皮肤
- 将 PNG 文件放置在
plugins/EIZZOs-NPCs/skins/ 中
- 运行
/npc set <id> skin filename.png
- 插件上传至 Mineskin API 进行纹理转换
- 纹理自动应用于 NPC
? 装备与护甲
装备按槽位存储在数据库中:
- 槽位: HAND, OFF_HAND, HEAD, CHEST, LEGS, FEET
- 完整 NBT 支持: 自定义物品、附魔、名称均保留
- 通过编辑器 GUI 设置: 将物品拖入槽位
? 奖励系统
Vault 经济
rewards:
use-vault: true
vault-message: "<green>+ ${amount} <gray>(NPC Kill)"
- 需要安装 Vault 插件
- NPC 被击杀时直接存入经济
- 可配置的消息,包含
{amount} 占位符
EIZZOs-Tokens 集成
rewards:
use-eizzos-tokens: true
token-message: "<gold>+ {amount} {currency} <gray>(NPC Kill)"
- 软依赖 EIZZOs-Tokens 插件
- 击杀时发放自定义令牌类型
- 每个 NPC 的令牌类型配置(
rewardTokenId)
奖励限制
# 在 NPC 属性中
rewardLimit: 10 # 每位玩家最多领取 10 次(0 = 无限)
- 在
player_reward_counts 表中跟踪每位玩家的领取次数
- 防止刷取奖励
? 示例
简单商人 NPC
/npc create merchant "Merchant Bob"
/npc set merchant type VILLAGER
/npc set merchant trackingmode STILL
/npc set merchant trackingrange 5
/npc set merchant sound entity.villager.trade
/npc addcmd merchant [opengui] merchant_shop
敌对守卫 NPC
/npc create guard "Castle Guard"
/npc set guard type ZOMBIE
/npc set guard hostile true
/npc set guard godmode false
/npc set guard trackingmode FOLLOW
/npc set guard trackingrange 15
/npc set guard vaultreward 50.0
带对话的任务 NPC
创建一个具有分支对话的 NPC:
-
创建 NPC:
/npc create questgiver "Quest Master"
/npc set questgiver type PLAYER
/npc set questgiver skin Notch
/npc set questgiver trackingmode STILL
-
通过 GUI 编辑:
-
添加后续节点:
带物理效果的移动 NPC
创建一个跳到平台的 NPC:
/npc create jumper "Parkour Pro"
/npc set jumper type PLAYER
/npc addcmd jumper [msg] Watch this!
/npc addcmd jumper [wait] 1
/npc addcmd jumper [jump]
/npc addcmd jumper [wait] 1
/npc addcmd jumper [home] world 100 75 200 0 0
重要提示: 在对话中使用 [home] 或 [jump] 时,插件会自动清除缓存的位置以防止回弹错误。
? 故障排除
NPC 未生成?
- 检查控制台中的
/npc create 错误
- 验证数据库是否可访问(SQLite 文件或 MySQL 连接)
- 确保区块已加载
NPC 弹回出生点?
- 关键: 当在对话中使用传送动作(
[home])时,确保插件清除了缓存的位置
- 这由对话系统自动处理
- 通过
/npc tp 进行的手动传送正常工作
对话选项无效?
- 在调试日志中验证令牌生成(
dialogue-to-console: true)
- 确认玩家已点击文本组件(而非仅输入命令)
- 确保对话操作格式为:
[choice] Option1=node1 | Option2=node2(使用竖线分隔)
皮肤未加载?
- Mojang API: 验证用户名有效且皮肤可用
- PNG 上传: 检查文件是否存在于
plugins/EIZZOs-NPCs/skins/
- Mineskin API: 检查控制台是否有 API 错误(如速率限制)
- 回退方案: 若 Mojang 失败,则使用 MC-Heads API
战斗功能无效?
- 验证
godmode 设置为 false
- 对于攻击性 NPC,检查
hostile 是否为 true
- 确保玩家处于生存模式或冒险模式(非创造模式/旁观者模式)
- 左键点击检测通过数据包拦截实现(适用于 Paper 1.21.1)
奖励未发放?
- Vault: 验证已安装 Vault 插件且经济提供商已激活
- 令牌: 若启用
use-eizzos-tokens: true,请验证已安装 EIZZOs-Tokens 插件
- 检查玩家的
rewardLimit 是否已达上限
- 启用
dialogue-to-console: true 以查看奖励执行日志
NPC 未追踪玩家?
- 验证
trackingmode 设置为 STILL 或 FOLLOW(非 NONE)
- 检查
trackingrange 是否足够大
- 确保玩家在 50 方块立方体范围内(裁剪范围)
- 使用
/npc debug 通过粒子效果可视化追踪范围
⚠️ 重要说明
关键注意事项
- 独立生命值: 一名玩家击杀 NPC 不会影响其他玩家的视角
- 基于数据包: NPC 并非实际实体;
Bukkit.getEntity() 无法找到它们
- 旁观者豁免: 旁观者玩家永远不会触发追踪或战斗逻辑
- 配置缩进: YAML 对缩进极其敏感;请使用 2 个空格,切勿使用制表符
- 对话超时:
[choice] / [listen] 操作设有 60 秒超时
- 令牌依赖: 软依赖 EIZZOs-Tokens;若缺失将记录警告日志
范围系统
- 裁剪范围: 64×64×64 立方体(硬编码用于显示/隐藏控制)
- 追踪范围: 每个 NPC 可单独配置(默认 10 方块)
- 立方体判定: 所有范围检查均使用
Math.abs(dx) <= range(非直线距离)
数据库
- 默认 SQLite:
plugins/EIZZOs-NPCs/npcs.db
- 可选 MySQL:需配置 HikariCP
- 自动迁移:版本更新时自动添加新列
? 许可证
EIZZOs 插件套件的一部分,适用于 Minecraft 多人网络服务器。
版本: 1.1.1
Minecraft: 1.21.1 (Paper)
作者: EIZZO
EIZZOs-NPCs
Packet-Based NPC System with intelligent movement, branching dialogue, combat mechanics, and per-player state tracking.
? Features
? Advanced NPC System
- Packet-Based Rendering - Client-side NPCs using network packets (not server entities)
- Per-Player State - Each player has unique NPC health, position, and dialogue progress
- 35+ Configurable Properties - Customize everything from tracking range to rewards
- Visual Editor GUI - In-game NPC management with chat-based property editing
? Dialogue System
- Branching Conversations - Multi-node dialogue trees with clickable choices
- Action Sequences - Messages, sounds, waits, teleports, rewards in dialogue
- One-Time Tokens - Secure choice validation prevents command exploitation
- Dialogue Once Mode - Track viewed nodes per player, skip seen content
⚔️ Combat & Tracking
- Three Tracking Modes - NONE (static), STILL (rotate only), FOLLOW (pathfind)
- Hostile NPCs - Attack players within range with weapon scaling
- Intelligent Pathfinding - Navigate obstacles, jump over blocks, avoid collisions
- Per-Player Health - Killing an NPC for one player doesn't affect others
? Customization
- Full Skin Support - Mojang API (usernames) or PNG file uploads via Mineskin
- Equipment System - Armor and hand items with full NBT support
- Sound Effects - Custom interaction sounds per NPC
- Debug Visualization - Particle grid showing tracking ranges
? Reward Integration
- Vault Economy - Give money on NPC kills
- EIZZOs-Tokens - Award custom tokens (soft dependency)
- Reward Limits - Optional per-player claim caps
- Custom Messages - Configurable reward notifications
? Commands
| Command |
Permission |
Description |
/npc |
eizzo.npcs.admin |
Open NPC list GUI |
/npc help |
- |
Show help menu |
/npc debug |
eizzo.npcs.admin |
Toggle debug particles (8-block cube visualization) |
/npc create <id> <name> |
eizzo.npcs.admin |
Create new NPC at your location |
/npc list |
eizzo.npcs.admin |
Open NPC list GUI |
/npc delete <id> |
eizzo.npcs.admin |
Permanently delete NPC |
/npc set <id> <property> <value> |
eizzo.npcs.admin |
Set NPC properties (see below) |
/npc tp <id> [world x y z yaw pitch] |
eizzo.npcs.admin |
Teleport NPC to your location or coords |
/npc addcmd <id> <command> |
eizzo.npcs.admin |
Add interaction command/action |
/npc clearcmds <id> |
eizzo.npcs.admin |
Clear all commands from NPC |
/npc dialog <id> <node> [token] [player] |
Admin/Token |
Execute dialogue node (console use requires player arg) |
NPC Set Properties
| Property |
Type |
Description |
name |
String |
Display name (supports MiniMessage) |
type |
EntityType |
Mob type (VILLAGER, ZOMBIE, SKELETON, PLAYER, etc.) |
skin |
String |
Player username or PNG filename in skins/ folder |
trackingmode |
NONE/STILL/FOLLOW |
Tracking behavior |
trackingrange |
Double |
Detection range in blocks |
hostile |
true/false |
Attacks players in range |
cape |
true/false |
Show cape for PLAYER type NPCs |
collision |
true/false |
Players can collide with NPC |
npccollision |
true/false |
NPCs collide with other NPCs |
flying |
true/false |
No gravity, 3D movement |
returntospawn |
true/false |
Returns to spawn when player leaves range |
nametag |
true/false |
Nametag visibility |
sound |
Sound key or "none" |
Sound on interaction (e.g., ui.button.click) |
godmode |
true/false |
Takes no damage |
respawndelay |
Integer |
Ticks before respawn after death (20 = 1 second) |
runmode |
op/console/player |
Command execution mode |
location |
world x y z yaw pitch |
Manual location setting |
? Permissions
| Permission |
Description |
eizzo.npcs.admin |
Full access to all NPC commands and editor GUIs |
Note: All commands except /npc help require admin permission. Dialogue execution requires either a valid session token OR admin permission.
?️ Configuration
Main Config (config.yml)
config-version: 1.1
tracking:
max-range: 50.0 # Server-side culling range (cube)
database:
type: "sqlite" # "sqlite" or "mysql"
host: "localhost"
port: 3306
database: "minecraft"
username: "root"
password: ""
pool-size: 10 # MySQL only
logging:
dialogue-to-console: true # Log dialogue executions
rewards:
enabled: true
max-amount: 1000.0 # Maximum reward per kill
use-vault: true # Enable Vault economy
use-eizzos-tokens: false # Enable EIZZOs-Tokens
vault-message: "<green>+ ${amount} <gray>(NPC Kill)"
token-message: "<gold>+ {amount} {currency} <gray>(NPC Kill)"
Database
- Default: SQLite at
plugins/EIZZOs-NPCs/npcs.db
- Optional: MySQL support via HikariCP connection pooling
- Tables:
npcs, npc_commands, npc_dialogues, npc_equipment, player_seen_nodes, player_reward_counts
? Interaction Mechanics
Player Interactions
- Left-Click (Attack): Damages NPC if not in GodMode; applies knockback and hurt animation
- Right-Click (Interact): Triggers dialogue or commands
- Sneak + Right-Click (Admin): Opens NPC editor GUI
Combat System
Weapon Damage Scaling:
- Base: Swords (6), Axes (7), Pickaxes (4), Shovels (3), Hoes (2), Fist (1)
- Material Bonuses: Netherite +2, Diamond +1.5, Iron +1.0, Stone +0.5
- Critical Hits: 1.5x damage when falling (not on ground)
Hostile Mode:
- NPCs chase and attack players within tracking range
- 1-second attack cooldown per player-NPC pair
- Knockback applied to attacked players
- Ignores Creative/Spectator mode players
? Dialogue System
Dialogue Actions
Actions are executed in order, one per line in dialogue nodes:
| Action |
Format |
Description |
[msg] |
[msg] Hello %player%! |
Send formatted NPC message |
[wait] |
[wait] 2.5 |
Pause dialogue for N seconds |
[sound] |
[sound] entity.villager.ambient |
Play sound effect |
[choice] |
[choice] Option1=next_node | Option2=another |
Show clickable buttons (generates tokens) |
[listen] |
[listen] [world] x y z |
Wait for player to move to specific block |
[reward] |
[reward] |
Give Vault/Token rewards to player |
[home] |
[home] world x y z yaw pitch |
Teleport NPC to location |
[jump] |
[jump] |
Apply upward velocity (1.6 blocks/tick) |
[set] |
[set] property1=value; property2=value |
Override NPC properties for this player |
Dialogue Once Mode
When enabled, tracks which nodes each player has viewed:
- Automatically skips to next unseen
start node (start, start1, start2, etc.)
- Falls back to standard commands if all nodes seen
- Stored in
player_seen_nodes database table
Token Security
- Each
[choice] generates random 6-character hex tokens
- Tokens are one-time use and expire on selection
- Prevents manual
/npc dialog command exploitation
- Admins bypass token validation (but still require token field)
? Movement & Physics
Tracking Modes
| Mode |
Behavior |
NONE |
NPC doesn't track; stays at spawn |
STILL |
Rotates head to face player but doesn't move |
FOLLOW |
Pathfinds toward player with collision avoidance |
Physics Constants
- Gravity: 1.0 blocks/tick (realistic falling)
- Movement Speed: 0.4 blocks/tick (normal), 0.6 blocks/tick (hostile)
- Stop Distance: 2.5 blocks (normal), 1.5 blocks (hostile)
- Jump Height: 1.1 blocks (auto-jumps obstacles ≤1 block tall)
- Step-Up Height: 0.6 blocks (step up ledges without jumping)
Collision System
- Player Collision: NPCs push players away if
collidable=true
- NPC-to-NPC: Collision only if both NPCs visible and
npcCollision=true
- Obstacle Avoidance: Navigates around solid blocks
- Spectator Immunity: Spectator mode players don't trigger tracking/collision
? Skin System
Player Skins
/npc set <id> skin Notch
- Fetches from Mojang API: Username → UUID → Texture properties
- Fallback: MC-Heads API if Mojang fails
- Async background processing (non-blocking)
Custom PNG Skins
- Place PNG file in
plugins/EIZZOs-NPCs/skins/
- Run
/npc set <id> skin filename.png
- Plugin uploads to Mineskin API for texture conversion
- Texture applied to NPC automatically
? Equipment & Armor
Equipment is stored per-slot in the database:
- Slots: HAND, OFF_HAND, HEAD, CHEST, LEGS, FEET
- Full NBT Support: Custom items, enchantments, names preserved
- Set via Editor GUI: Drag items into slots
? Reward System
Vault Economy
rewards:
use-vault: true
vault-message: "<green>+ ${amount} <gray>(NPC Kill)"
- Requires Vault plugin installed
- Direct economy deposit on NPC kill
- Configurable message with
{amount} placeholder
EIZZOs-Tokens Integration
rewards:
use-eizzos-tokens: true
token-message: "<gold>+ {amount} {currency} <gray>(NPC Kill)"
- Soft dependency on EIZZOs-Tokens plugin
- Awards custom token types on kill
- Per-NPC token type configuration (
rewardTokenId)
Reward Limits
# In NPC properties
rewardLimit: 10 # Max 10 claims per player (0 = unlimited)
- Tracks claims per player in
player_reward_counts table
- Prevents reward farming
? Examples
Simple Merchant NPC
/npc create merchant "Merchant Bob"
/npc set merchant type VILLAGER
/npc set merchant trackingmode STILL
/npc set merchant trackingrange 5
/npc set merchant sound entity.villager.trade
/npc addcmd merchant [opengui] merchant_shop
Hostile Guard NPC
/npc create guard "Castle Guard"
/npc set guard type ZOMBIE
/npc set guard hostile true
/npc set guard godmode false
/npc set guard trackingmode FOLLOW
/npc set guard trackingrange 15
/npc set guard vaultreward 50.0
Quest NPC with Dialogue
Create an NPC with branching dialogue:
-
Create NPC:
/npc create questgiver "Quest Master"
/npc set questgiver type PLAYER
/npc set questgiver skin Notch
/npc set questgiver trackingmode STILL
-
Edit via GUI:
-
Add Follow-Up Nodes:
Moving NPC with Physics
Create an NPC that jumps to a platform:
/npc create jumper "Parkour Pro"
/npc set jumper type PLAYER
/npc addcmd jumper [msg] Watch this!
/npc addcmd jumper [wait] 1
/npc addcmd jumper [jump]
/npc addcmd jumper [wait] 1
/npc addcmd jumper [home] world 100 75 200 0 0
IMPORTANT: When using [home] or [jump] in dialogue, the plugin automatically clears cached location to prevent snap-back bugs.
? Troubleshooting
NPC not spawning?
- Check console for errors on
/npc create
- Verify database is accessible (SQLite file or MySQL connection)
- Ensure chunk is loaded
NPC snapping back to spawn?
- CRITICAL: When using teleport actions in dialogue (
[home]), ensure plugin clears cached location
- This is handled automatically by the dialogue system
- Manual teleports via
/npc tp work correctly
Dialogue choices not working?
- Verify token generation in debug logs (
dialogue-to-console: true)
- Check player has clicked the text component (not just typed command)
- Ensure dialogue action format:
[choice] Option1=node1 | Option2=node2 (pipe-separated)
Skin not loading?
- Mojang API: Verify username is valid and skin is available
- PNG Upload: Check file exists in
plugins/EIZZOs-NPCs/skins/
- Mineskin API: Check console for API errors (rate limiting)
- Fallback: MC-Heads API used if Mojang fails
Combat not working?
- Verify
godmode is set to false
- Check
hostile is true for attacking NPCs
- Ensure player is in Survival/Adventure mode (not Creative/Spectator)
- Left-click detection uses packet interception (works on Paper 1.21.1)
Rewards not giving?
- Vault: Verify Vault plugin installed and economy provider active
- Tokens: Verify EIZZOs-Tokens plugin installed if
use-eizzos-tokens: true
- Check
rewardLimit hasn't been reached for player
- Enable
dialogue-to-console: true to see reward execution logs
NPCs not tracking players?
- Verify
trackingmode is set to STILL or FOLLOW (not NONE)
- Check
trackingrange is sufficient
- Ensure player is within 50-block cube (culling range)
- Use
/npc debug to visualize tracking range with particles
⚠️ Important Notes
Critical Gotchas
- Per-Player Health: Killing an NPC for one player doesn't affect other players' views
- Packet-Based: NPCs are not actual entities;
Bukkit.getEntity() won't find them
- Spectator Exemption: Spectator players never trigger tracking/combat
- Config Indentation: YAML is extremely sensitive; use 2 spaces, never tabs
- Dialogue Timeouts: 60-second timeout on
[choice]/[listen] actions
- Token Dependency: Soft dependency on EIZZOs-Tokens; logs warning if missing
Range System
- Culling Range: 64×64×64 cube (hardcoded for show/hide)
- Tracking Range: Configurable per NPC (default 10 blocks)
- Cube-Based: All range checks use
Math.abs(dx) <= range (not distance)
Database
- SQLite default:
plugins/EIZZOs-NPCs/npcs.db
- MySQL optional: Requires HikariCP configuration
- Automatic migrations: New columns added on version updates
? License
Part of the EIZZOs plugin suite for Minecraft multiplayer networks.
Version: 1.1.1
Minecraft: 1.21.1 (Paper)
Author: EIZZO
评论 0
登录后参与评分
还没有评论,来抢沙发吧