Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by felix121felix, Jun 2, 2017.
I want to get the event when a piston is Powered but cant extend.
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.
Thank you, but how do i get the block which cant be moved?
you get the Direction by #event.getDirection()
thanks. I have the direction.... and now?
Specify what you wanna do, please!
I want to break the block which will be moved.
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()
Thank you it works!