--- a/net/minecraft/world/item/BoatItem.java
+++ b/net/minecraft/world/item/BoatItem.java
@@ -1,5 +1,6 @@
 package net.minecraft.world.item;
 
+import java.util.Iterator;
 import java.util.List;
 import java.util.function.Predicate;
 import net.minecraft.stats.Stats;
@@ -14,10 +15,12 @@
 import net.minecraft.world.level.Level;
 import net.minecraft.world.level.gameevent.GameEvent;
 import net.minecraft.world.phys.AABB;
+import net.minecraft.world.phys.BlockHitResult;
 import net.minecraft.world.phys.HitResult;
 import net.minecraft.world.phys.Vec3;
 
 public class BoatItem extends Item {
+
     private static final Predicate<Entity> ENTITY_PREDICATE = EntitySelector.NO_SPECTATORS.and(Entity::isPickable);
     private final Boat.Type type;
     private final boolean hasChest;
@@ -30,50 +33,71 @@
 
     @Override
     public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
-        ItemStack itemStack = user.getItemInHand(hand);
-        HitResult hitResult = getPlayerPOVHitResult(world, user, ClipContext.Fluid.ANY);
-        if (hitResult.getType() == HitResult.Type.MISS) {
-            return InteractionResultHolder.pass(itemStack);
+        ItemStack itemstack = user.getItemInHand(hand);
+        BlockHitResult movingobjectpositionblock = getPlayerPOVHitResult(world, user, ClipContext.Fluid.ANY);
+
+        if (movingobjectpositionblock.getType() == HitResult.Type.MISS) {
+            return InteractionResultHolder.pass(itemstack);
         } else {
-            Vec3 vec3 = user.getViewVector(1.0F);
-            double d = 5.0D;
-            List<Entity> list = world.getEntities(user, user.getBoundingBox().expandTowards(vec3.scale(5.0D)).inflate(1.0D), ENTITY_PREDICATE);
+            Vec3 vec3d = user.getViewVector(1.0F);
+            double d0 = 5.0D;
+            List<Entity> list = world.getEntities((Entity) user, user.getBoundingBox().expandTowards(vec3d.scale(5.0D)).inflate(1.0D), BoatItem.ENTITY_PREDICATE);
+
             if (!list.isEmpty()) {
-                Vec3 vec32 = user.getEyePosition();
+                Vec3 vec3d1 = user.getEyePosition();
+                Iterator iterator = list.iterator();
 
-                for(Entity entity : list) {
-                    AABB aABB = entity.getBoundingBox().inflate((double)entity.getPickRadius());
-                    if (aABB.contains(vec32)) {
-                        return InteractionResultHolder.pass(itemStack);
+                while (iterator.hasNext()) {
+                    Entity entity = (Entity) iterator.next();
+                    AABB axisalignedbb = entity.getBoundingBox().inflate((double) entity.getPickRadius());
+
+                    if (axisalignedbb.contains(vec3d1)) {
+                        return InteractionResultHolder.pass(itemstack);
                     }
                 }
             }
 
-            if (hitResult.getType() == HitResult.Type.BLOCK) {
-                Boat boat = this.getBoat(world, hitResult);
-                boat.setType(this.type);
-                boat.setYRot(user.getYRot());
-                if (!world.noCollision(boat, boat.getBoundingBox())) {
-                    return InteractionResultHolder.fail(itemStack);
+            if (movingobjectpositionblock.getType() == HitResult.Type.BLOCK) {
+                // CraftBukkit start - Boat placement
+                org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callPlayerInteractEvent(user, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectpositionblock.getBlockPos(), movingobjectpositionblock.getDirection(), itemstack, hand);
+
+                if (event.isCancelled()) {
+                    return InteractionResultHolder.pass(itemstack);
+                }
+                // CraftBukkit end
+                Boat entityboat = this.getBoat(world, movingobjectpositionblock);
+
+                entityboat.setType(this.type);
+                entityboat.setYRot(user.getYRot());
+                if (!world.noCollision(entityboat, entityboat.getBoundingBox())) {
+                    return InteractionResultHolder.fail(itemstack);
                 } else {
                     if (!world.isClientSide) {
-                        world.addFreshEntity(boat);
-                        world.gameEvent(user, GameEvent.ENTITY_PLACE, hitResult.getLocation());
+                        // CraftBukkit start
+                        if (org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callEntityPlaceEvent(world, movingobjectpositionblock.getBlockPos(), movingobjectpositionblock.getDirection(), user, entityboat).isCancelled()) {
+                            return InteractionResultHolder.fail(itemstack);
+                        }
+
+                        if (!world.addFreshEntity(entityboat)) {
+                            return InteractionResultHolder.pass(itemstack);
+                        }
+                        // CraftBukkit end
+                        world.gameEvent((Entity) user, GameEvent.ENTITY_PLACE, movingobjectpositionblock.getLocation());
                         if (!user.getAbilities().instabuild) {
-                            itemStack.shrink(1);
+                            itemstack.shrink(1);
                         }
                     }
 
                     user.awardStat(Stats.ITEM_USED.get(this));
-                    return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide());
+                    return InteractionResultHolder.sidedSuccess(itemstack, world.isClientSide());
                 }
             } else {
-                return InteractionResultHolder.pass(itemStack);
+                return InteractionResultHolder.pass(itemstack);
             }
         }
     }
 
     private Boat getBoat(Level world, HitResult hitResult) {
-        return (Boat)(this.hasChest ? new ChestBoat(world, hitResult.getLocation().x, hitResult.getLocation().y, hitResult.getLocation().z) : new Boat(world, hitResult.getLocation().x, hitResult.getLocation().y, hitResult.getLocation().z));
+        return (Boat) (this.hasChest ? new ChestBoat(world, hitResult.getLocation().x, hitResult.getLocation().y, hitResult.getLocation().z) : new Boat(world, hitResult.getLocation().x, hitResult.getLocation().y, hitResult.getLocation().z));
     }
 }
