NPCLib icon indicating copy to clipboard operation
NPCLib copied to clipboard

NPCs Not Spawning

Open EazyFTW opened this issue 4 years ago • 5 comments

Describe the bug NPCs don't always spawn.

NPCLib usage option 3

NPCLib JAR name npclib-plugin-2.8-SNAPSHOT.jar

Server version This server is running CraftBukkit version git-Spigot-ad703da-e2403a3 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT) (latest at the time of posting this)

To Reproduce Steps to reproduce the behavior: Try to spawn NPCs. Using example 1 as an example:

    @EventHandler
    public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
        if (event.isSneaking()) {
            return;
        }

        NPC npc = npcLib.createNPC();
        npc.setLocation(event.getPlayer().getLocation());
        npc.create();
        npc.show(event.getPlayer());
    }

Also, it seems to work even less if you try to make the NPC be on fire.

Expected behavior A NPC spawns every time.

Screenshots I tried getting a mp4 of the issue, but couldn't.

Sometimes after a while it just stops working.

Additional context ~Add any other context about the problem here.~

EazyFTW avatar Jun 29 '20 03:06 EazyFTW

I managed to get a clip off the issue with NPCs on fire. But the same thing happens with normal NPCs except after a while they don't work at all.

https://i.eazyftw.com/5JyU75h.mp4

EazyFTW avatar Jun 29 '20 04:06 EazyFTW

Figured out it only works when you're looking down. (30+ pitch)

EazyFTW avatar Jun 29 '20 04:06 EazyFTW

Could be related/similar or the same as #96

EazyFTW avatar Jun 29 '20 04:06 EazyFTW

I've had a somewhat similar issue when spawning in an NPC while not looking at it causes it to not load properly. However, after spawning properly it continues to work fine. Canceling the NPCHideEvent if the plugin tries to hide it automatically fixed the problem.

Edit: Having this issue on all versions 1.8.3 to 1.16.1

Mooselk avatar Jul 03 '20 22:07 Mooselk

Came across this today as well. It's pretty common for players to spawn NPCs at their location and to have them trip out and be invisible is odd. Might be worth a one-off check in this specific scenario as I wouldn't call this an edge case.

Took some debugging to figure out I needed to really not spawn it on top of me.

Cryptite avatar Mar 31 '21 14:03 Cryptite