#NPC don't spawn on plugin startup!

30 messages · Page 1 of 1 (latest)

shut harness
#

Hello,

On the event CitizensEnableEvent i'm creating a SimpleNPCDataStore and then loading it into a CitizensAPI.createCitizensBackedNPCRegistry.
Finally i'm calling NPCRegistry.loadInto(myDataStore) but npc's are not spawning on the server !

Can someone help me with that please ?

Thank you

barren obsidianBOT
#

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.

shut harness
#

It work if i add a delay in the event.

native walrusBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command 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.)

#

@shut harness

shut harness
#

This is not resolved!

#

@frail sparrow

shut harness
#

This is in the "onEnable" method

#

And it is not working, it is directly inspired from your code

#

In the console > SPAWNED 1

shut harness
#

Any ideas ?

#

In addition, it work with default npc command, but when i use my custom storage, npc's only spawn if I add delay to the event! What am I doing wrong ? I can't find any docs, and I read your code, still can't figure out why i'm getting this problem.

frail sparrow
#

Need more code

#

You just posted a snippet

shut harness
#

You have all you need, can be easily reproduce, just put this code in onEnable method.

#

There is no more code

frail sparrow
#

@shut harness the implementation of createStorageNPC?

shut harness
shut harness
#

BUMP

shut harness
#

BUMP

indigo cairn
#

@shut harness patients please

shut harness
#

Alright

frail sparrow
#

works perfectly fine (code runs after citizensenableevent)

native walrusBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command 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.)

#

@shut harness

frail sparrow
#
YamlStorage yamlStorage = new YamlStorage(new File(CitizensAPI.getDataFolder(), "test.yml"));
            yamlStorage.load();
            NPCDataStore npcds = SimpleNPCDataStore.create(yamlStorage);
            NPCRegistry npcReg = CitizensAPI.createCitizensBackedNPCRegistry(npcds);
          npcds.loadInto(npcReg);
native walrusBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command 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.)

#

@shut harness