From 8b43d9325916d78e5ccdb5800eed97d7eaf24437 Mon Sep 17 00:00:00 2001 From: StijnSimons Date: Sat, 20 Jul 2019 01:37:43 +0200 Subject: [PATCH] i forgot players and items were entities too --- src/api/java/baritone/api/utils/ExampleBaritoneControl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java index 1b47c8a56..0f2e08156 100644 --- a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java +++ b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java @@ -35,6 +35,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ChunkProviderClient; import net.minecraft.crash.CrashReport; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ReportedException; @@ -421,7 +422,7 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener Optional toFollow = Optional.empty(); for (Entity entity : ctx.world().loadedEntityList) { String entityName = entity.getName().trim().toLowerCase(); - if (entityName.contains(name) || name.contains(entityName)) { + if ((entityName.contains(name) || name.contains(entityName)) && !(entity instanceof EntityItem || entity instanceof EntityPlayer)) { // We dont want it following players while `#follow` exists. toFollow = Optional.of(entity); } }