From 80d899a53a5f12c6209b024ff2f15a95820ed954 Mon Sep 17 00:00:00 2001 From: Felix Cravic Date: Fri, 27 Nov 2020 10:47:35 +0100 Subject: [PATCH] EntityCreature scheduling priority for pathfinding can now be modified --- .../net/minestom/server/entity/EntityCreature.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/net/minestom/server/entity/EntityCreature.java b/src/main/java/net/minestom/server/entity/EntityCreature.java index 7443b8327..9724b31da 100644 --- a/src/main/java/net/minestom/server/entity/EntityCreature.java +++ b/src/main/java/net/minestom/server/entity/EntityCreature.java @@ -1,6 +1,7 @@ package net.minestom.server.entity; import com.extollit.gaming.ai.path.HydrazinePathFinder; +import com.extollit.gaming.ai.path.SchedulingPriority; import com.extollit.gaming.ai.path.model.IPath; import net.minestom.server.attribute.Attributes; import net.minestom.server.collision.CollisionUtils; @@ -406,6 +407,16 @@ public abstract class EntityCreature extends LivingEntity { return pathPosition; } + /** + * Changes the pathfinding priority for this entity. + * + * @param schedulingPriority the new scheduling priority + * @see Scheduling Priority + */ + public void setPathfindingPriority(@NotNull SchedulingPriority schedulingPriority) { + this.pathFinder.schedulingPriority(schedulingPriority); + } + /** * Used to move the entity toward {@code direction} in the X and Z axis * Gravity is still applied but the entity will not attempt to jump