#(Lycheeeees) setTarget location teleports npcs

26 messages · Page 1 of 1 (latest)

quasi plaza
#

Hey, sometimes (i believe when the npc is too far away from the target location) it teleports to it instead of walking to that location. For some reason it also doesnt pathfind all the way to the exact location but close to it. Like sometimes it stops walking 1 block from the acctual target location. Any idea how to fix this?

queen shellBOT
#

(Lycheeeees) setTarget location teleports npcs

queen shellBOT
#

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>

quasi plaza
#

I also get an error when deleting npc's in the CitizensEnableEvent.

#

this is the way i delete all the npc's:

public void despawnAndDeleteAllNPCs() {
        NPCRegistry npcRegistry = CitizensAPI.getNPCRegistry();
        for (NPC npc : npcRegistry) {
            npc.despawn(); // Despawn the NPC
            npc.destroy(); // Delete the NPC
        }
    }```
#

nvm that last code i found the way

lusty vapor
quasi plaza
#

what

#

own registry?

#

wdym by that?

lusty vapor
quasi plaza
#

the thing that bothers me the most tho is i want the npc to always have max health. Still take damage but no effect on health.

I use this event listener but it doesnt work:

public class NPCDamageEvent implements Listener {

    @EventHandler
    public void onNPCDamage(net.citizensnpcs.api.event.NPCDamageEvent e) {
        e.setDamage(0);
    }
}```
mystic atlas
# quasi plaza Hey, sometimes (i believe when the npc is too far away from the target location)...

This page contains frequently asked questions regarding the Citizens project. You should always check here before submitting an issue, asking on Discord, or posting on the forum thread. Your queries could very well have already been answered here.

mystic atlas
quasi plaza
#

it ended up working by using a entitydamagebyentityevent and checking if its an npc.

quasi plaza
tawdry ironBOT
#
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.)

#

@quasi plaza