--- a/net/minecraft/world/entity/ai/goal/SitWhenOrderedToGoal.java
+++ b/net/minecraft/world/entity/ai/goal/SitWhenOrderedToGoal.java
@@ -1,10 +1,12 @@
 package net.minecraft.world.entity.ai.goal;
 
 import java.util.EnumSet;
+import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.LivingEntity;
 import net.minecraft.world.entity.TamableAnimal;
 
 public class SitWhenOrderedToGoal extends Goal {
+
     private final TamableAnimal mob;
 
     public SitWhenOrderedToGoal(TamableAnimal tameable) {
@@ -20,15 +22,15 @@
     @Override
     public boolean canUse() {
         if (!this.mob.isTame()) {
-            return false;
+            return this.mob.isOrderedToSit() && this.mob.getTarget() == null; // CraftBukkit - Allow sitting for wild animals
         } else if (this.mob.isInWaterOrBubble()) {
             return false;
         } else if (!this.mob.onGround()) {
             return false;
         } else {
-            LivingEntity livingEntity = this.mob.getOwner();
-            return livingEntity == null
-                || (!(this.mob.distanceToSqr(livingEntity) < 144.0) || livingEntity.getLastHurtByMob() == null) && this.mob.isOrderedToSit();
+            LivingEntity entityliving = this.mob.getOwner();
+
+            return entityliving == null ? true : (this.mob.distanceToSqr((Entity) entityliving) < 144.0D && entityliving.getLastHurtByMob() != null ? false : this.mob.isOrderedToSit());
         }
     }
 
