--- a/net/minecraft/server/EntitySilverfish.java
+++ b/net/minecraft/server/EntitySilverfish.java
@@ -157,6 +157,11 @@
IBlockData iblockdata = world.getType(blockposition);
if (BlockMonsterEggs.x(iblockdata)) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, Blocks.MONSTER_EGG, Block.getId(BlockMonsterEggs.getById(iblockdata.getBlock().toLegacyData(iblockdata)))).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, Blocks.MONSTER_EGG.getBlockData().set(BlockMonsterEggs.VARIANT, BlockMonsterEggs.EnumMonsterEggVarient.a(iblockdata)), 3);
this.a.doSpawnEffect();
this.a.die();
@@ -200,6 +205,11 @@
IBlockData iblockdata = world.getType(blockposition1);
if (iblockdata.getBlock() == Blocks.MONSTER_EGG) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, Blocks.AIR, 0).isCancelled()) {
+ continue;
if (world.getGameRules().getBoolean("mobGriefing")) {
world.setAir(blockposition1, true);
} else {