Break sign on failure?

Discussion in 'Plugin Development' started by RastaLulz, Aug 12, 2011.

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

    RastaLulz

    How would I go about breaking a sign on failure? I'm creating a sign based plugin, and I want to break the sign if it doesn't meet the template specified (on the sign) for using the plugin.

    I know that I can do the following, but I don't want them to lose the sign..

    Code:
    event.getBlock().setTypeId(0);
     
  2. Offline

    Kryptos

    Mhm... this should work:

    Code:
    
     Block block = event.getBlock();
     block.setType(Material.AIR);
     block.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(Material.SIGN, 1));
    
     
  3. Offline

    RastaLulz

    Thanks.. I got that from ChestShop, and sent it to you on MSN.

    Regardless, issue resolved.
     
Thread Status:
Not open for further replies.

Share This Page