Prevent TNT destroying some type of block

Discussion in 'Plugin Development' started by k4b4l74, Apr 14, 2011.

Thread Status:
Not open for further replies.
  1. Offline



    I've tried in the BlockListener.onBlockDamage() and onBlockBreak() methods to set event.setCancelled(true) if the block is a REDSTONE_ORE for exemple.

    Players can not destroy the block but the TNT can :(

    How can i do please ?

    Thanks !
  2. Offline

    Edward Hand

    TNT triggers the EntityExplode event (an entity event).

    You can cancel that event to prevent damage. The event also has a getBlockList() method which will tell you what blocks will be destroyed.
  3. Offline


    Thanks a lot !
Thread Status:
Not open for further replies.

Share This Page