Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.14.2 NPC's Not Spawning #1790

Closed
YourCoal opened this issue May 20, 2019 · 20 comments

Comments

Projects
None yet
5 participants
@YourCoal
Copy link

commented May 20, 2019

When attempting to spawn an NPC that I created, it throws this InvocationTargetException/NullPointerException error. This seemed to have only after updating my spigot.jar build to the recent build from earlier this morning (20 May 2019, AM U.S. time).

The following is what I am using to spawn NPCs (which worked before). The error occurs when calling npc.spawn();
// Structure NPCs public NPC createNPC(String displayName, Location loc, BlockData blockData) { NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.VILLAGER, displayName); npc.setProtected(true); npc.addTrait(new NPCStructureTrait(this)); npc.spawn(loc); // npc.spawn(findFixedLoc(loc, blockData)); Entity ent = npc.getEntity(); ent.setCustomNameVisible(true); ent.setCustomName(displayName); this.structureNPCs.add(npc); return npc; }

Server error: https://pastebin.com/ABb810bw
Citizens config: It is the default generated one (but here is link in case: https://pastebin.com/svi6FkeD )

The output of command /version on my server is: git-Spigot-03bd4b0-49e15b4 (MC: 1.14.1)
The output of command /version citizens on my server is: 2.0.25-SNAPSHOT (build 1692)

@fullwall

This comment has been minimized.

Copy link
Member

commented May 21, 2019

Can you post your startup log

@YourCoal

This comment has been minimized.

Copy link
Author

commented May 21, 2019

@fullwall

This comment has been minimized.

Copy link
Member

commented May 21, 2019

What version of java are you using?

@YourCoal

This comment has been minimized.

Copy link
Author

commented May 21, 2019

12.0.9

@fullwall

This comment has been minimized.

Copy link
Member

commented May 21, 2019

Try latest build. Out of curiosity, did every server update to java 12 recently? Why so much switching?

@YourCoal

This comment has been minimized.

Copy link
Author

commented May 21, 2019

The latest build fixes the issue.

I am only to 12 now because I was told to get off of java and move to openjdk, which ended up being 12. Though I was told more people are heading to 12 since 8 is losing support soon? I don't know much about how those are released so I cannot help much for that.

@YourCoal YourCoal closed this May 21, 2019

@YourCoal

This comment has been minimized.

Copy link
Author

commented May 21, 2019

I didn't want to include this but I just noticed it, the entities will no longer spawn if a player is not loading the chunks it looks like.

@YourCoal YourCoal reopened this May 21, 2019

@mcmonkey4eva

This comment has been minimized.

Copy link
Member

commented May 21, 2019

There's a lot of entity spawning issues in minecraft 1.14.1 itself, which is slated to be fixed in 1.14.2

Also: If you're on a Debian/Ubuntu server, sudo apt install openjdk-8-jdk, similarish for RHEL/CentOS servers.
OpenJDK 8 is still the most stable and supported.

We're trying to improve support for newer Java versions, however there's a few snags here and there as the team at Oracle in charge of Java are doing their best to remove all the most useful features for some reason. (Note that removing features at all ever is considered extremely bad practice in large public APIs regardless, making Oracle's actions particularly egregious .-.)

@YourCoal

This comment has been minimized.

Copy link
Author

commented May 23, 2019

I was able to get the NPCs to spawn after calling loc.getWorld().loadChunk

@mcmonkey4eva

This comment has been minimized.

Copy link
Member

commented May 27, 2019

Please reply below so we can reopen if you can replicate spawning issues on 1.13.2, or on 1.14.2 after Citizens builds for it are available, now that Spigot has that available. Otherwise will assume the issue is fixed

@Lix3nn53

This comment has been minimized.

Copy link

commented May 28, 2019

Hello, I believe this issue is related to this thread: Non of my villagers NPCs are spawning. In 1.14.1 there was a debugger message like "attempting to spawn but failed" but in 1.14.2 there isn't even a debug message, they are just not spawning.

lastest spigot and citizens versions, here is the full log: https://pastebin.com/SCBqkeYt

You can see I am teleporting to '8' but none of villager NPCs nearby spawns. Only player NPC nearby which is '31' spawns.

@YourCoal

This comment has been minimized.

Copy link
Author

commented May 29, 2019

Can confirm NPCs still not spawning if chunk not loaded.

@mcmonkey4eva mcmonkey4eva reopened this May 29, 2019

@mcmonkey4eva

This comment has been minimized.

Copy link
Member

commented May 29, 2019

@YourCoal @Lix3nn53 is the issue specific to villager NPCs? (ie: only Villager NPCs disappear, all others are fine)?

@mcmonkey4eva mcmonkey4eva changed the title Exception(s) when attempting NPC.spawn 1.14.2 NPC's Not Spawning May 29, 2019

@Lix3nn53

This comment has been minimized.

Copy link

commented May 29, 2019

@YourCoal @Lix3nn53 is the issue specific to villager NPCs? (ie: only Villager NPCs disappear, all others are fine)?

Yes, my player NPCs works fine but villager NPCs doesn't spawn. I can test other types if you want

@mcmonkey4eva

This comment has been minimized.

Copy link
Member

commented May 29, 2019

the Minecraft 1.14 update reworked how villagers function heavily. Minecraft 1.14.x itself and Spigot are both still having issues in general with villager entities.
I'm not sure if there's an issue in Citizens here... and if there is, it's likely to be simple failure to compensate for some weird code change in the NMS.

@Lix3nn53

This comment has been minimized.

Copy link

commented May 29, 2019

Idk if it helps but when I do /citizens reload, nearby Villager NPCs are spawning

@0xC1A551C

This comment has been minimized.

Copy link

commented May 29, 2019

Same issue for me!

@0xC1A551C

This comment has been minimized.

Copy link

commented May 29, 2019

The villagers despawning has been a issue since 1.13.2 including some villagers just vanishing while others are still there. No one seems to really care or look into it further. It is a lot worse now though. Unable to use villager NPCs at all

@mcmonkey4eva

This comment has been minimized.

Copy link
Member

commented Jun 11, 2019

Just an update on this:
A variety of users have reported similar problems, and some seemed to indicate that it may also affect player-type NPCs (not just villagers), (however most have for whatever reason chosen not to add their own details to this issue post.)

@mcmonkey4eva

This comment has been minimized.

Copy link
Member

commented Jun 12, 2019

As this issue is a mess, let's redirect to #1822

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.