From 89d79e64dbe9a394e0d6c8444601dcb2e3fabf80 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 4 Dec 2012 19:16:33 -0600 Subject: [PATCH] Add API for controlling mob despawn away from players. Adds BUKKIT-2986 By: Travis Watkins --- .../main/java/org/bukkit/entity/LivingEntity.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java index e93453a394..af29239751 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -278,4 +278,19 @@ public interface LivingEntity extends Entity { * @return true if there is a line of sight, false if not. */ public boolean hasLineOfSight(Entity other); + + /** + * Returns if the entity despawns when away from players or not.
+ * By default animals are not removed while other mobs are. + * + * @return true if the entity is removed when away from players + */ + public boolean getRemoveWhenFarAway(); + + /** + * Sets whether or not the entity despawns when away from players or not. + * + * @param remove The remove status + */ + public void setRemoveWhenFarAway(boolean remove); }