Stop the dropping of signs, saplings, etc. on block break

Discussion in 'Plugin Development' started by mdcollins05, Feb 16, 2012.

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

    mdcollins05

    Hi, I'm trying to find out how to stop signs, saplings, redstone dust and a few others from dropping on the ground when the block underneath is broken. I don't know how possible this is, but I don't know where to start to determine if something had came off. I've looked at the bukkit documentation with no success.

    Any suggestions?
    Thanks for your time.
     
  2. Offline

    Vandrake

    i believe it is possible by doing two actions on break block event
    you use block.getRelative(BlockFace.UP)
    block is my getBlock() variable.
    you check it by doing
    if blockabove(getType.SAPLING or so(Cant remember the name)) == block(the block the user is destroying).getRelative(BlockFace.UP) you cancel the event preventing the player from destroying the block by doing
    setCanceled(true);

    I'm sorry that I can't explain it very well but my head is a mess xD I have the main blueprint in my head though
     
Thread Status:
Not open for further replies.

Share This Page