Mob Pathfinding API

Adds an API to allow plugins to instruct a Mob to Pathfind to a Location or Entity

This does not do anything to stop other AI rules from changing the location, so
it is still up to the plugin to control that or override after another goal changed
the location.

You can use EntityPathfindEvent to cancel new pathfinds from overriding your current.
This commit is contained in:
Aikar
2018-09-09 12:39:06 -04:00
parent 9bcb238879
commit 2983b658fc
2 changed files with 229 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package org.bukkit.entity;
import org.bukkit.Sound;
import org.bukkit.loot.Lootable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -12,6 +13,13 @@ public interface Mob extends LivingEntity, Lootable {
// Paper start
@Override
org.bukkit.inventory.@org.jetbrains.annotations.NotNull EntityEquipment getEquipment();
/**
* Enables access to control the pathing of an Entity
* @return Pathfinding Manager for this entity
*/
@NotNull
com.destroystokyo.paper.entity.Pathfinder getPathfinder();
// Paper end
/**
* Instructs this Mob to set the specified LivingEntity as its target.