Solved Help please

Discussion in 'Plugin Development' started by Forseth11, Jan 12, 2014.

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

    Forseth11

    Hello. I am adding a function into one of my plugins that allows RPGs and grenades to destroy the ground, buildings and terrain. I have got that to work, but I can not seem to find a way to make it come back. What is the best way to reset a map. It is about 1000 by 1000 blocks and I only need to reset from 30 Y to 125 Y. How would I go about doing this with all the players on?

    EDIT: Better yet. How would I make it all come back in 60 seconds with out making torches, ladders, signs, and sand fall. I have a delay set up, but the problem is when it puts the blocks back there is a chance that a bed, door, trapdoor, sign, ladder, torches, ext will fall. How would I make the terrain destroyed respawn with out any changes?
     
  2. Offline

    adam753

    Assuming you don't want anything perma-breakable in this minigame, you could put the timer in BlockBreakEvent. Every time a block breaks, set a timer to put it back after 60 seconds. I'm pretty sure that would cover beds and doors as well as wall attachments.
     
  3. Offline

    Forseth11

    adam753 I will try that.

    adam753 Block break event is not called when there is an explosion.

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

    adam753

    Forseth11 Ah, not that easy then. Okay, how about if you do what you were doing before with EntityExplodeEvent, but also do that with BlockPhysicsEvent? BlockPhysicsEvent is called when a block changes and updates an adjacent block - for example, a torch falling down because the block it's attached to got changed somehow. You could set a timer inside there to set things back after 60 seconds.
     
  5. Offline

    Forseth11

    adam753 That worked thank you.
     
Thread Status:
Not open for further replies.

Share This Page