#(advait) NMS#setDestination isn't working?

8 messages · Page 1 of 1 (latest)

wheat cloak
#

I'm not sure if I'm misunderstanding the method, but this code:

    @CommandAlias("nmswalktome")
    public void runNMSWalkToMe(Player player) {
        if (CitizensAPI.getDefaultNPCSelector().getSelected(player) == null) {
            player.sendMessage(Component.text("You have no NPC selected!", NamedTextColor.RED));
            return;
        }

        PatheticNPC npc = PatheticNPCRegistry.getInstance().getPatheticNPC(
                CitizensAPI.getDefaultNPCSelector().getSelected(player));

        if (npc == null) {
            player.sendMessage(Component.text("The selected NPC does not have the Pathetic trait!", NamedTextColor.RED));
            return;
        }

        NMS.updatePathfindingRange(npc.getCitizensNPC(), 500f);
        NMS.setDestination(npc.getCitizensNPC().getEntity(), player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), 2.0F);
        player.sendMessage(Component.text(npc.getName() + " is walking to you via NMS... (Destination:" + NMS.getDestination(npc.getCitizensNPC().getEntity()) + ")", NamedTextColor.GREEN));
    }

just makes the NPC look at the destination, but it makes no attempt to walk to the destination. I've tried looking everywhere I possibly could in the Citizens source code but I have no idea why it isn't working, especially considering the A* pathfinder uses this same method https://cdn.discordapp.com/attachments/1350659172995305494/1350664039272943697/idea64_cFvSO1oQrB.png?ex=67d78f69&is=67d63de9&hm=52997741d15bb1eb289ec95599b96d4c5ac169236614815f54e0cac9c280948f& to get the NPC to move. am i doing something wrong?

gusty chasmBOT
#

(advait) NMS#setDestination isn't working?

gusty chasmBOT
#

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.

drifting rapids
#

Needs to be called every tick

torn coralBOT
#
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.)

#

@wheat cloak

wheat cloak
#

thank you! that was exactly the issue