--- a/net/minecraft/world/entity/monster/EntitySilverfish.java +++ b/net/minecraft/world/entity/monster/EntitySilverfish.java @@ -33,6 +33,10 @@ import net.minecraft.world.level.block.BlockMonsterEggs; import net.minecraft.world.level.block.state.IBlockData; +// CraftBukkit start +import org.bukkit.craftbukkit.event.CraftEventFactory; +// CraftBukkit end + public class EntitySilverfish extends EntityMonster { @Nullable @@ -175,6 +179,11 @@ Block block = iblockdata.getBlock(); if (block instanceof BlockMonsterEggs) { + // CraftBukkit start + if (!CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState())) { + continue; + } + // CraftBukkit end if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { world.destroyBlock(blockposition1, true, this.silverfish); } else { @@ -244,6 +253,11 @@ IBlockData iblockdata = world.getBlockState(blockposition); if (BlockMonsterEggs.isCompatibleHostBlock(iblockdata)) { + // CraftBukkit start + if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, BlockMonsterEggs.infestedStateByHost(iblockdata))) { + return; + } + // CraftBukkit end world.setBlock(blockposition, BlockMonsterEggs.infestedStateByHost(iblockdata), 3); this.mob.spawnAnim(); this.mob.discard();