--- a/net/minecraft/world/level/block/DragonEggBlock.java
+++ b/net/minecraft/world/level/block/DragonEggBlock.java
@@ -15,8 +15,10 @@
 import net.minecraft.world.phys.BlockHitResult;
 import net.minecraft.world.phys.shapes.CollisionContext;
 import net.minecraft.world.phys.shapes.VoxelShape;
+import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit
 
 public class DragonEggBlock extends FallingBlock {
+
     protected static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
 
     public DragonEggBlock(BlockBehaviour.Properties settings) {
@@ -25,7 +27,7 @@
 
     @Override
     public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE;
+        return DragonEggBlock.SHAPE;
     }
 
     @Override
@@ -40,24 +42,38 @@
     }
 
     private void teleport(BlockState state, Level world, BlockPos pos) {
-        WorldBorder worldBorder = world.getWorldBorder();
+        WorldBorder worldborder = world.getWorldBorder();
 
-        for(int i = 0; i < 1000; ++i) {
-            BlockPos blockPos = pos.offset(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
-            if (world.getBlockState(blockPos).isAir() && worldBorder.isWithinBounds(blockPos)) {
+        for (int i = 0; i < 1000; ++i) {
+            BlockPos blockposition1 = pos.offset(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
+
+            if (world.getBlockState(blockposition1).isAir() && worldborder.isWithinBounds(blockposition1)) {
+                // CraftBukkit start
+                org.bukkit.block.Block from = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
+                org.bukkit.block.Block to = world.getWorld().getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ());
+                BlockFromToEvent event = new BlockFromToEvent(from, to);
+                org.bukkit.Bukkit.getPluginManager().callEvent(event);
+
+                if (event.isCancelled()) {
+                    return;
+                }
+
+                blockposition1 = new BlockPos(event.getToBlock().getX(), event.getToBlock().getY(), event.getToBlock().getZ());
+                // CraftBukkit end
                 if (world.isClientSide) {
-                    for(int j = 0; j < 128; ++j) {
-                        double d = world.random.nextDouble();
+                    for (int j = 0; j < 128; ++j) {
+                        double d0 = world.random.nextDouble();
                         float f = (world.random.nextFloat() - 0.5F) * 0.2F;
-                        float g = (world.random.nextFloat() - 0.5F) * 0.2F;
-                        float h = (world.random.nextFloat() - 0.5F) * 0.2F;
-                        double e = Mth.lerp(d, (double)blockPos.getX(), (double)pos.getX()) + (world.random.nextDouble() - 0.5D) + 0.5D;
-                        double k = Mth.lerp(d, (double)blockPos.getY(), (double)pos.getY()) + world.random.nextDouble() - 0.5D;
-                        double l = Mth.lerp(d, (double)blockPos.getZ(), (double)pos.getZ()) + (world.random.nextDouble() - 0.5D) + 0.5D;
-                        world.addParticle(ParticleTypes.PORTAL, e, k, l, (double)f, (double)g, (double)h);
+                        float f1 = (world.random.nextFloat() - 0.5F) * 0.2F;
+                        float f2 = (world.random.nextFloat() - 0.5F) * 0.2F;
+                        double d1 = Mth.lerp(d0, (double) blockposition1.getX(), (double) pos.getX()) + (world.random.nextDouble() - 0.5D) + 0.5D;
+                        double d2 = Mth.lerp(d0, (double) blockposition1.getY(), (double) pos.getY()) + world.random.nextDouble() - 0.5D;
+                        double d3 = Mth.lerp(d0, (double) blockposition1.getZ(), (double) pos.getZ()) + (world.random.nextDouble() - 0.5D) + 0.5D;
+
+                        world.addParticle(ParticleTypes.PORTAL, d1, d2, d3, (double) f, (double) f1, (double) f2);
                     }
                 } else {
-                    world.setBlock(blockPos, state, 2);
+                    world.setBlock(blockposition1, state, 2);
                     world.removeBlock(pos, false);
                 }
 
