#(riches) npc.getEntity() returns null

16 messages · Page 1 of 1 (latest)

mental aurora
#

Hello! I am using the developer api, and when creating a NPC, npc.getEntity returns null. I know it is spawned, any ideas?

        this.entity = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, name);
        this.entity.spawn(new Location(loc.getWorld(), loc.getX() + 31.5, loc.getY() + 17, loc.getZ() + 66));
        System.out.println(this.entity.getEntity()); // prints null
```There is the code
bright narwhalBOT
#

(riches) npc.getEntity() returns null

#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

mental aurora
#

It also creates two NPCs in the saves.yml config, even tho I am not creating the npc twice

hasty vapor
#

As of 1.19, paper sometimes takes a few ticks to actually put the entity in the world

plain grottoBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please type </resolved:1028673926114594866> to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@mental aurora