Stop Sign Breaking

Discussion in 'Plugin Development' started by will181, Aug 4, 2014.

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

    will181

    Hello there!

    I was wondering, I know how to stop a sign breaking if a player just punches it, but how can I stop the sign breaking if something else happens to it? For instance, if someone broke the block the block that a sign was placed on, the sign would break. How can I stop a player from breaking that block, and therefore stop that sign from breaking?

    Do I listen for the BlockPhysicsEvent? If so (I have never used that before), how on Earth do I figure out if a sign has broken from that? Can I just continue to listen to the BlockBreakEvent?

    Sorry if this seems like a stupid question, but I am trully stuck here.

    Thank you to anyone who can offer help.
     
  2. Offline

    _LB

    There are not currently events for blocks that are attached to other blocks, you just have to know what causes a block to break and stop that from happening. For signs you need to see if the block broken has a protected sign on it, which also means checking which block the sign is actually placed on. You also need to handle pistons moving the bock the sign is on. BlockPhysicsEvent for signs on sand/gravel/anvils/ etc
     
  3. Offline

    will181

    _LB Okay, thank you. That was very helpful.

    _LB Does BlocksPhysicsEvent include tnt?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  4. Offline

    _LB

    I don't know - most servers don't even let you place TNT so I think it will be pretty rare (and hilarious) to find a sign placed on TNT (is it even possible?)
     
  5. Offline

    will181

    _LB Okay, fair point.
     
Thread Status:
Not open for further replies.

Share This Page