#(API) NPC Navigation (increasing vectors)
18 messages · Page 1 of 1 (latest)
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.
so e.g, if
final Iterable<Vector> vectors = npc.getNavigator().getPathStrategy().getPath();
returned me a list of 10 positions, I'd instead want 40 more detailed positions
@rustic lantern
Thread was closed either automatically by timeout or by the Discord manual close button. If closing was intentional, please use </resolved:1028673926114594866> or </invalid:1028673926898909185>.
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.)
@rustic lantern
I did resolve this but I did want to ask whether it's possible to get the navigation path that an NPC would take before they actually start navigating
like I want to get the result of "canNavigateTo" as vectors instead of a boolean
Yes, you can
You can get the path as a list of vectors through navigator api
See the Java doc
package index
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.)
@rustic lantern
npc.getNavigator().setTarget(entity.getLocation());
final Iterable<Vector> vectors = npc.getNavigator().getPathStrategy().getPath();
npc.getNavigator().cancelNavigation();```
I did a system like this earlier, is that the method you were referring to?
I would use this consistently, just the only problem is that I have to put a delay task after setting target, else the vectors are null (which makes sense)
ideally wouldn't want the NPC trying to run to a certain area for a second and then it cancels
Resolved!