--- a/net/minecraft/world/item/StandingAndWallBlockItem.java
+++ b/net/minecraft/world/item/StandingAndWallBlockItem.java
@@ -4,13 +4,20 @@
 import javax.annotation.Nullable;
 import net.minecraft.core.BlockPos;
 import net.minecraft.core.Direction;
+import net.minecraft.server.level.ServerPlayer;
 import net.minecraft.world.item.context.BlockPlaceContext;
+import net.minecraft.world.level.Level;
 import net.minecraft.world.level.LevelReader;
 import net.minecraft.world.level.block.Block;
 import net.minecraft.world.level.block.state.BlockState;
 import net.minecraft.world.phys.shapes.CollisionContext;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.block.data.CraftBlockData;
+import org.bukkit.event.block.BlockCanBuildEvent;
+// CraftBukkit end
 
 public class StandingAndWallBlockItem extends BlockItem {
+
     public final Block wallBlock;
     private final Direction attachmentDirection;
 
@@ -27,22 +34,39 @@
     @Nullable
     @Override
     protected BlockState getPlacementState(BlockPlaceContext context) {
-        BlockState blockState = this.wallBlock.getStateForPlacement(context);
-        BlockState blockState2 = null;
-        LevelReader levelReader = context.getLevel();
-        BlockPos blockPos = context.getClickedPos();
+        BlockState iblockdata = this.wallBlock.getStateForPlacement(context);
+        BlockState iblockdata1 = null;
+        Level world = context.getLevel();
+        BlockPos blockposition = context.getClickedPos();
+        Direction[] aenumdirection = context.getNearestLookingDirections();
+        int i = aenumdirection.length;
 
-        for (Direction direction : context.getNearestLookingDirections()) {
-            if (direction != this.attachmentDirection.getOpposite()) {
-                BlockState blockState3 = direction == this.attachmentDirection ? this.getBlock().getStateForPlacement(context) : blockState;
-                if (blockState3 != null && this.canPlace(levelReader, blockState3, blockPos)) {
-                    blockState2 = blockState3;
+        for (int j = 0; j < i; ++j) {
+            Direction enumdirection = aenumdirection[j];
+
+            if (enumdirection != this.attachmentDirection.getOpposite()) {
+                BlockState iblockdata2 = enumdirection == this.attachmentDirection ? this.getBlock().getStateForPlacement(context) : iblockdata;
+
+                if (iblockdata2 != null && this.canPlace(world, iblockdata2, blockposition)) {
+                    iblockdata1 = iblockdata2;
                     break;
                 }
             }
         }
 
-        return blockState2 != null && levelReader.isUnobstructed(blockState2, blockPos, CollisionContext.empty()) ? blockState2 : null;
+        // CraftBukkit start
+        if (iblockdata1 != null) {
+            boolean defaultReturn = world.isUnobstructed(iblockdata1, blockposition, CollisionContext.empty());
+            org.bukkit.entity.Player player = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null;
+
+            BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(world, blockposition), player, CraftBlockData.fromData(iblockdata1), defaultReturn, org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(context.getHand())); // Paper - Expose hand in BlockCanBuildEvent
+            context.getLevel().getCraftServer().getPluginManager().callEvent(event);
+
+            return (event.isBuildable()) ? iblockdata1 : null;
+        } else {
+            return null;
+        }
+        // CraftBukkit end
     }
 
     @Override
