Solved How to create a custom 'ticking' block?

Discussion in 'Plugin Development' started by austinv11, May 31, 2014.

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

    austinv11

    Hello, I was wondering how I would go about making a block 'tick', so that after a certain amount of time, the block does something, like spawn a mob for example. I was thinking of using databases, and simply going through the database of my 'ticking' blocks and updating them one by one, but I feel as this may cause some lag when there's a lot of these blocks. Thanks for any help!
     
  2. Offline

    Zupsub

    Just use bukkit's scheduler and its runTaskLater method.
     
  3. Offline

    Arkel

    You could use the scheduler to set up a task that spawns the mob. Be careful to only make Bukkit API calls on the main server thread; see this article
     
  4. Offline

    RawCode

    not spoonfeeding section austinv11

    provide your own coding attempts and debug\stack stace
     
  5. Offline

    austinv11


    I wasn't asking for code, I was just looking for ideas on ways to do this.

    Thanks guys! I'll look into the scheduler!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
Thread Status:
Not open for further replies.

Share This Page