--- a/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
+++ b/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
@@ -7,14 +7,17 @@
 import net.minecraft.world.level.block.Block;
 
 public class BreakDoorGoal extends DoorInteractGoal {
+
     private static final int DEFAULT_DOOR_BREAK_TIME = 240;
     private final Predicate<Difficulty> validDifficulties;
     protected int breakTime;
-    protected int lastBreakProgress = -1;
-    protected int doorBreakTime = -1;
+    protected int lastBreakProgress;
+    protected int doorBreakTime;
 
     public BreakDoorGoal(Mob mob, Predicate<Difficulty> difficultySufficientPredicate) {
         super(mob);
+        this.lastBreakProgress = -1;
+        this.doorBreakTime = -1;
         this.validDifficulties = difficultySufficientPredicate;
     }
 
@@ -29,10 +32,7 @@
 
     @Override
     public boolean canUse() {
-        return super.canUse()
-            && this.mob.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)
-            && this.isValidDifficulty(this.mob.level().getDifficulty())
-            && !this.isOpen();
+        return !super.canUse() ? false : (!this.mob.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.isValidDifficulty(this.mob.level().getDifficulty()) && !this.isOpen());
     }
 
     @Override
@@ -43,10 +43,7 @@
 
     @Override
     public boolean canContinueToUse() {
-        return this.breakTime <= this.getDoorBreakTime()
-            && !this.isOpen()
-            && this.doorPos.closerToCenterThan(this.mob.position(), 2.0)
-            && this.isValidDifficulty(this.mob.level().getDifficulty());
+        return this.breakTime <= this.getDoorBreakTime() && !this.isOpen() && this.doorPos.closerToCenterThan(this.mob.position(), 2.0D) && this.isValidDifficulty(this.mob.level().getDifficulty());
     }
 
     @Override
@@ -65,18 +62,27 @@
             }
         }
 
-        this.breakTime++;
-        int i = (int)((float)this.breakTime / (float)this.getDoorBreakTime() * 10.0F);
+        ++this.breakTime;
+        int i = (int) ((float) this.breakTime / (float) this.getDoorBreakTime() * 10.0F);
+
         if (i != this.lastBreakProgress) {
             this.mob.level().destroyBlockProgress(this.mob.getId(), this.doorPos, i);
             this.lastBreakProgress = i;
         }
 
         if (this.breakTime == this.getDoorBreakTime() && this.isValidDifficulty(this.mob.level().getDifficulty())) {
+            // CraftBukkit start
+            if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreakDoorEvent(this.mob, this.doorPos, this.mob.level().getFluidState(this.doorPos).createLegacyBlock()).isCancelled()) { // Paper - fix wrong block state
+                this.start();
+                return;
+            }
+            // CraftBukkit end
+            final net.minecraft.world.level.block.state.BlockState oldState = this.mob.level().getBlockState(this.doorPos); // Paper - fix MC-263999
             this.mob.level().removeBlock(this.doorPos, false);
             this.mob.level().levelEvent(1021, this.doorPos, 0);
-            this.mob.level().levelEvent(2001, this.doorPos, Block.getId(this.mob.level().getBlockState(this.doorPos)));
+            this.mob.level().levelEvent(2001, this.doorPos, Block.getId(oldState)); // Paper - fix MC-263999
         }
+
     }
 
     private boolean isValidDifficulty(Difficulty difficulty) {
