NPCLib icon indicating copy to clipboard operation
NPCLib copied to clipboard

Fix NPC not fully loading if constructed when no players are online

Open Archonic944 opened this issue 4 years ago • 1 comments

Describe the bug If an NPC is constructed using NPCLib#createNPC() while no players are online, that NPC, no matter when it is created, will only show armor stand lines when calling NPC#show on a certain player. At no point was an exception thrown relating to NPCLib, or during NPC creation, and at no point was the NPCLib instance I was using null.

NPCLib usage option 2

NPCLib JAR name NPCLib.jar (My JAR is renamed. However, the plugin loader states the plugin name as "NPCLibPlugin v2.11.1-SNAPSHOT").

Server version git-NachoSpigot-"39f2882" (MC: 1.8.8) (Implementing API version 1.8.8-R0.2-SNAPSHOT)

To Reproduce Steps to reproduce the behavior:

  • Used code https://pastebin.com/DweH4itS
  • Construct & create NPC immediately on server start, or before any players have joined (either one)
  • Show NPC for any player on join

Expected behavior I expected for the entire NPC to be spawned, not just its name tags, immediately after a player joined.

Screenshots Screen Shot 2021-12-29 at 9 41 55 PM

Additional context I actually have already cobbled together a little fix for this problem by queuing an NPC's creation for the next PlayerJoinEvent if no players are currently online. Maybe that'll help?

Archonic944 avatar Dec 30 '21 02:12 Archonic944

Im having the same probleme

TheDumbledodo avatar Jan 30 '22 12:01 TheDumbledodo