-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial docs for Entity Pathfinders and Mob Goal API #289
base: main
Are you sure you want to change the base?
Conversation
this needs notes on how vanilla selects which goals to activate and prolly some more caveats on how pathfinding works from somebody who actually uses the pathfinder, iirc it can ge all kinda wonky to call moveTo every tick. |
@Override | ||
public void stop() { | ||
// This is called when the goal stops. In this case, we just send a message to the player. | ||
player.sendMessage(text("I Stopped following you!")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
player.sendMessage(text("I Stopped following you!")); | |
player.sendMessage(text("I stopped following you!")); |
boolean success = pathfinder.moveTo(player.getLocation()); | ||
``` | ||
|
||
If we want to access the current Path for the cow, we can call `getCurrentPath()` on the pathfinder: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to access the current Path for the cow, we can call `getCurrentPath()` on the pathfinder: | |
If we want to access the current path for the cow, we can call `getCurrentPath()` on the pathfinder: |
|
||
## Stopping the Pathfinder | ||
|
||
You can call `stopPathfinding()` on the pathfinder to stop the pathfinder. This will stop the pathfinder and clear the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit redundant
@@ -0,0 +1,126 @@ | |||
--- | |||
slug: /dev/mob-goals | |||
description: A guide to the PDC API for storing data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong
} | ||
|
||
@Override | ||
public @NotNull GoalKey<Camel> getKey() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the NotNull annotations it's better to assume types are not null by default
I have not extensively used either of these API's in the past, however these seem to work