@@ -5,8 +5,8 @@ description: A guide to the Entity Pathfinder API.
55
66# Entity Pathfinder API
77
8- The Entity Pathfinder API is a way of controlling the movement of entities in Minecraft. It allows you to set a path
9- for an entity to follow, such as moving to a location, or following a player.
8+ The Entity Pathfinder API is a way of controlling the movement of entities in Minecraft. It allows you to set a path
9+ for an entity to follow, such as moving to a location, or following a player.
1010
1111## Accessing the Pathfinder
1212
@@ -27,17 +27,17 @@ Player player = ...;
2727
2828Pathfinder pathfinder = cow. getPathfinder();
2929// moveTo returns a boolean indicating whether the path was set successfully
30- boolean success = pathfinder. moveTo(player. getLocation());
30+ boolean success = pathfinder. moveTo(player. getLocation());
3131```
3232
33- If we want to access the current Path for the cow, we can call ` getCurrentPath() ` on the pathfinder:
33+ If we want to access the current path for the cow, we can call ` getCurrentPath() ` on the pathfinder:
3434
3535``` java
3636PathResult path = pathfinder. getCurrentPath();
3737
3838// A PathResult is essentially a wrapper around a List of Locations. These can be accessed with:
3939List<Location > locations = path. getPoints();
40- // It is important to note that the list contains points that have already been passed,
40+ // It is important to note that the list contains points that have already been passed,
4141// as well as future points. If you want to get the next point, you can use:
4242Location nextPoint = path. getNextPoint(); // Or locations.get(path.getNextPointIndex())
4343// Finally, you can access the final destination with:
@@ -48,10 +48,10 @@ Location destination = path.getFinalPoint();
4848
4949Much of the way that the Pathfinder works is dictated by the limitations of the actual entity pathfinding in Minecraft.
5050For example, a Polar Bear cannot fly. This means that if you set a path for a Polar Bear to a location that is in the air,
51- it will not be able to reach it.
51+ it will not be able to reach it.
5252
5353Some attributes can be set on the pathfinder to change the way that the pathfinder works. These are:
54- - ` setCanOpenDoors(boolean) ` : Whether the entity can open doors. This is relevant for Zombies breaking down doors, and
54+ - ` setCanOpenDoors(boolean) ` : Whether the entity can open doors. This is relevant for Zombies breaking down doors, and
5555Villagers opening doors.
5656- ` setCanPassDoors(boolean) ` : Whether the entity can pass through open doors.
5757- ` setCanFloat(boolean) ` : Whether the entity can float in water.
@@ -60,4 +60,4 @@ These all have respective getters as well.
6060## Stopping the Pathfinder
6161
6262You can call ` stopPathfinding() ` on the pathfinder to stop the pathfinder. This will stop the pathfinder and clear the
63- current path. You can use ` hasPath() ` to check if the pathfinder is running.
63+ current path. You can use ` hasPath() ` to check if the pathfinder is running.
0 commit comments