Hello. I need some help with piston events badly, as I can't get them to work. It should return; when the moved blocks or pulled block is a Sponge. I tried my best, but it kept bugging out, so I came here to ask you guys for help :3 Thank you! ~ Reteckz
This won't cover all aspects of a piston but should help you understand what direction you need to start looking in. Hint: the piston may still pull the block. Code: @EventHandler public void herpderp(BlockPistonEvent e){ if (e.getBlock().getRelative(e.getDirection).getType == Material.SPONGE) e.setCancelled(true); }