Solved Generating blocks

Discussion in 'Plugin Development' started by Wantsome909, Dec 2, 2013.

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

    Wantsome909

    How would you be able to generate blocks. with BlockBreakEvent?

    Fix: like i break a block and a few minuets later it comes back?
     
  2. Offline

    PieMan456

    Wantsome909
    What do you mean generate blocks? Replace the block broken with a different block?
     
  3. Offline

    Wantsome909

  4. Offline

    PieMan456

    Wantsome909
    Well you would just get the location of the broken block and put a different block there
     
  5. Offline

    sgavster

    Code:java
    1. @EventHandler
    2. public void onBreak(BlockBreakEvent e) {
    3. Block b = e.getBlock();
    4. Bukkit.getScheduler().runTaskLater(this, new Runnable() {
    5. public void run() {
    6. e.getBlock().setType(b);
    7. }
    8. }, ((60*20)*5));//it would set it back 5 minutes later (untested)
    9. }
     
Thread Status:
Not open for further replies.

Share This Page