--- a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
+++ b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
@@ -6,8 +6,13 @@
 import net.minecraft.world.entity.animal.horse.AbstractHorse;
 import net.minecraft.world.entity.player.Player;
 import net.minecraft.world.phys.Vec3;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
 
 public class RunAroundLikeCrazyGoal extends Goal {
+
     private final AbstractHorse horse;
     private final double speedModifier;
     private double posX;
@@ -23,13 +28,14 @@
     @Override
     public boolean canUse() {
         if (!this.horse.isTamed() && this.horse.isVehicle()) {
-            Vec3 vec3 = DefaultRandomPos.getPos(this.horse, 5, 4);
-            if (vec3 == null) {
+            Vec3 vec3d = DefaultRandomPos.getPos(this.horse, 5, 4);
+
+            if (vec3d == null) {
                 return false;
             } else {
-                this.posX = vec3.x;
-                this.posY = vec3.y;
-                this.posZ = vec3.z;
+                this.posX = vec3d.x;
+                this.posY = vec3d.y;
+                this.posZ = vec3d.z;
                 return true;
             }
         } else {
@@ -51,15 +57,18 @@
     public void tick() {
         if (!this.horse.isTamed() && this.horse.getRandom().nextInt(this.adjustedTickDelay(50)) == 0) {
             Entity entity = this.horse.getFirstPassenger();
+
             if (entity == null) {
                 return;
             }
 
-            if (entity instanceof Player player) {
+            if (entity instanceof Player) {
+                Player entityhuman = (Player) entity;
                 int i = this.horse.getTemper();
                 int j = this.horse.getMaxTemper();
-                if (j > 0 && this.horse.getRandom().nextInt(j) < i) {
-                    this.horse.tameWithName(player);
+
+                if (j > 0 && this.horse.getRandom().nextInt(j) < i && !CraftEventFactory.callEntityTameEvent(this.horse, ((CraftHumanEntity) this.horse.getBukkitEntity().getPassenger()).getHandle()).isCancelled()) { // CraftBukkit - fire EntityTameEvent
+                    this.horse.tameWithName(entityhuman);
                     return;
                 }
 
@@ -68,7 +77,8 @@
 
             this.horse.ejectPassengers();
             this.horse.makeMad();
-            this.horse.level().broadcastEntityEvent(this.horse, (byte)6);
+            this.horse.level().broadcastEntityEvent(this.horse, (byte) 6);
         }
+
     }
 }
