diff --git a/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java b/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java index 05c8fe5..8d94f41 100644 --- a/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java +++ b/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java @@ -10,6 +10,7 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.FallingBlock; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntitySpawnEvent; import org.bukkit.event.world.WorldLoadEvent; @@ -100,11 +101,12 @@ public class FoliaFlow extends JavaPlugin implements Listener { // } // } @EventHandler - public void onEntitySpawn(EntitySpawnEvent event) { - if (event.getEntity() instanceof FallingBlock) { - FallingBlock block = (FallingBlock) event.getEntity(); - if (block.getWorld().getEnvironment() == World.Environment.THE_END) { - // The falling block is in the End world + public void onBlockBreak(BlockBreakEvent event) { + Block block = event.getBlock(); + if (block.getWorld().getEnvironment() == World.Environment.THE_END) { + // The block is in the End world + if (block.getBlockData() instanceof FallingBlock) { + // The block that was broken is a falling block String message = "I found a falling block in the End!"; Bukkit.broadcastMessage(message); } @@ -115,6 +117,7 @@ public class FoliaFlow extends JavaPlugin implements Listener { + @EventHandler public void onFallingBlockToBlock(EntityChangeBlockEvent e){ if(e.getEntityType() == EntityType.FALLING_BLOCK){