From 39e74188e0155f3dab546f97f0c142d1fb3aad52 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 11 Dec 2013 21:13:04 -0600 Subject: [PATCH] Fix setting entity's target. Fixes BUKKIT-1358 Setting the goal target overrides the entity's will to do something else. This makes it so entities like wolves with attack another player with .setTarget(), instead of hanging next to their owner. By: PaulBGD --- .../main/java/org/bukkit/craftbukkit/entity/CraftCreature.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java index b9905dbbe0..a6c0b94e5c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java @@ -15,9 +15,11 @@ public class CraftCreature extends CraftLivingEntity implements Creature { EntityCreature entity = getHandle(); if (target == null) { entity.target = null; + entity.setGoalTarget(null); } else if (target instanceof CraftLivingEntity) { entity.target = ((CraftLivingEntity) target).getHandle(); entity.pathEntity = entity.world.findPath(entity, entity.target, 16.0F, true, false, false, true); + entity.setGoalTarget(((CraftLivingEntity) target).getHandle()); } }