#(kmyk441) How to make sure im not spawning npcs 2 times

33 messages · Page 1 of 1 (latest)

granite python
#

npc:

  • name: "name"
    world: "world"
    x: 0
    y: 70
    z: 0
    pitch: 0 #optional
    yaw: 0 #optional

this is my yml config, user can add any amount of npcs, im wondering how to make sure there is only one of each. should i just remove all of them at onDisable and then spawn them ? (the config can change)

rotund flintBOT
#

(kmyk441) How to make sure im not spawning npcs 2 times

rotund flintBOT
#

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.

sly widget
granite python
sly widget
#

I need some more context

frank ploverBOT
#
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.)

#

@granite python

unreal blade
#

imo, each item in yml array is unique so every npc you spawned is unique. did you mean only spawn npcs that are newly added through config by users?

#

however IDK why you need to implement this on your side, as Citizens already managed the persisted NPCs

granite python
#

i just used TemporalNPCRegistry and i think it works ideally

unreal blade
#

it makes sense as you re-creates NPC when your plugin enables

#

glad to hear you worked that out

granite python
#

yayy

unborn helmBOT
#

+> YAY!!!

granite python
#

uhm

#

what is that

#

yay

unborn helmBOT
#

+> YAY!!!

granite python
#

yayyyyy

unborn helmBOT
#

+> YAY!!!

granite python
#

yay

unborn helmBOT
#

+> YAY!!!

granite python
#

ya

#

aya

#

yay

unborn helmBOT
#

+> YAY!!!

jolly glacier
#

As fun as that is, don't spam the bot please.

frank ploverBOT
#
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.)

#

@granite python

granite python