Solved How to get if piston can't extend

Discussion in 'Spigot Plugin Development' started by felix121felix, Jun 2, 2017.

  1. I want to get the event when a piston is Powered but cant extend.
     
    • Like Like x 1
  2. You can check out the BlockPistonEvent. This way you will get the direction the piston is facing. When the event is cancelled, the block cant be moved.
     
    • Like Like x 1
  3. Thank you, but how do i get the block which cant be moved?
     
    • Like Like x 1
  4. you get the Direction by #event.getDirection()
     
    • Like Like x 1
  5. thanks. I have the direction.... and now?
     
  6. Specify what you wanna do, please!
     
    • Like Like x 1
  7. I want to break the block which will be moved.
     
  8. get the location by the direction with getRelatives() or just subtract the location. But I dont know the specific method for this. Then you hav to execute #getBlock().breakNaturally()
     
    • Useful Useful x 1