diff --git a/src/main/java/pokecube/adventures/capabilities/CapabilityHasPokemobs.java b/src/main/java/pokecube/adventures/capabilities/CapabilityHasPokemobs.java index 7df08604bc..a1a0d8c0cb 100644 --- a/src/main/java/pokecube/adventures/capabilities/CapabilityHasPokemobs.java +++ b/src/main/java/pokecube/adventures/capabilities/CapabilityHasPokemobs.java @@ -636,7 +636,10 @@ public void setPokemob(final int slot, final ItemStack cube) public void onSetTarget(final LivingEntity target, final boolean ignoreCanBattle) { final LivingEntity old = this.getTarget(); + // No calling this if we already have that target. if (old == target) return; + // No calling this if we are the target. + if (target == this.getTrainer()) return; if (!ignoreCanBattle && target != null && !this.canBattle(target, true).test()) return; @@ -660,7 +663,6 @@ public void onSetTarget(final LivingEntity target, final boolean ignoreCanBattle } final IHasPokemobs other = TrainerCaps.getHasPokemobs(target); - System.out.println(other + " " + this.getTrainer().getDisplayName().getFormattedText()); if (other != null) other.onSetTarget(this.getTrainer(), true); if (target != null && this.getAttackCooldown() <= 0)