-
-
Notifications
You must be signed in to change notification settings - Fork 0
API Troubleshooting
Eisi05 edited this page Jan 21, 2026
·
1 revision
Common reasons:
- The NPC is disabled and the viewer is not OP / doesn’t have
npc.admin.- Fix:
npc.setEnabled(true)or test as OP.
- Fix:
- Player is in another world.
-
showNPCToPlayer(...)will hide the NPC if the player world differs.
-
- The NPC’s chunk is not loaded.
-
showNPCToPlayer(...)exits early if the chunk is not loaded.
-
- If you created NpcAPI with
new NpcConfig().autoUpdate(false), thensetOption(...)won’t push packets.- Fix: call
npc.reload(). - Or enable
autoUpdate(true).
- Fix: call
- Skin changes often require a reload to resend player info packets.
- Mojang fetch can fail (rate limit / offline / invalid name). Always handle
Optional.empty().
PathfindingUtils.findPath(...) can throw PathfindingException if a segment can’t be found.
- Fix: ensure waypoints are walkable and not inside blocks.
- Increase
maxIterationsfor harder paths.
- Ensure you call
NpcApi.disable()inonDisable(). - If you have multiple plugins shading NpcAPI, avoid classpath conflicts.
-
npc.save()also serializes the click handler (NpcClickAction). - Avoid lambdas that capture plugin instances or other non-serializable objects.