Well i am messing around with a plugin i am making. It compiles great loads in to Craft-Bukkit great but its not doing what its supposed to basically i am trying to get it to Delete TNT if a place hits it Code: package com.bukkit.insain.BoomBeGone; import org.bukkit.Material; import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockListener; import org.bukkit.block.BlockDamageLevel; public class BoomBeGoneBlockListener extends BlockListener { private final BoomBeGone plugin; public BoomBeGoneBlockListener(BoomBeGone plugin) { this.plugin = plugin; } public void onBlockDamaged(BlockDamageEvent event) { if ((event.getDamageLevel() == BlockDamageLevel.BROKEN) && event.getBlock().getType() .equals(Material.TNT)) { event.getBlock().setType(Material.AIR); } } } now as we see here there's no errors Logically but obviously there is a bug some where and i can't seem to snuff it out any help would be great
Hum ... as you say, you're code seems to be good. Try with an other type of block and replace the Material.AIR with an other material to really see an effect.
Nope still didnt work i know theres a bug in the code format some where just can find it Edit Here is the Main file of the Script maybe something here? --- merged: Jan 16, 2011 8:28 AM --- Oh Man i Feel Stupid Looking at it right now i know exactly what i did wrong i forgot to add a Cancel :\ silly Insain
I was going to say the same thing after seeing the source code of this plugin. So, it's working now ? And, what does the setCancelled statement means ?
Basically SetCancelled will Cancel the Destroying of the block and cause it to turn in to the correct one now now that i got this working i can hop on to Creepers yay