Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

timer and onBlockBreak

Comments in 'Plugin Development' started by a9eelsh, Nov 12, 2014.

  1. a9eelsh
    Offline

    a9eelsh New Member

    Joined:
    Nov 6, 2014
    Posts:
    16
    Minecraft User:
    a9eelsh
    Welcome,
    I need to solve the problem you make a mini game and you make a counter to start playing onBlockPlace and onBlockBreak
    $ event-> setCancelled (true) I want to work after missing the end of time is thus $ event-> setCancelled () I'm not good in English
  2. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    What do you exactly want? To cancel a BlockPlace/Break until the game start?
  3. a9eelsh
    Offline

    a9eelsh New Member

    Joined:
    Nov 6, 2014
    Posts:
    16
    Minecraft User:
    a9eelsh
    Break until the game start
  4. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Ok, you should have a timer, the when you cancel an Event is because it was triggered, it's like when you press a button, it does something, and to make it do that thing again, you need to press it again...
    Events are called when a certain action is triggered, so you can use an if/else switch according to the timer:
    (Supposing that the timer is reverse-counting 30 seconds and the game start when the timer finishes....
    PHP:
    $timer 30
    //Code that manages the timer
    if ($times 0) {
         
    $event->setCancelled(true);
    }
    What will this do? it will only block the Event (Do not let that action, that now it's a block break) if the Timer haven't finished (the game haven't started)

    I'm trying to be as explanatory as possible, if you need more help, feel free to ask me again ;)
    PEMapModder likes this.
  5. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
  6. a9eelsh
    Offline

    a9eelsh New Member

    Joined:
    Nov 6, 2014
    Posts:
    16
    Minecraft User:
    a9eelsh
    I am a novice at this, please give me the full code
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If you want the full code, just put it in the plugin requests section.
  8. a9eelsh
    Offline

    a9eelsh New Member

    Joined:
    Nov 6, 2014
    Posts:
    16
    Minecraft User:
    a9eelsh
    I do not know how to please help me
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I mean, if you can't even make use of such a detailed tutorial post made by @iksaku, how could you even make a plugin?
  10. a9eelsh
    Offline

    a9eelsh New Member

    Joined:
    Nov 6, 2014
    Posts:
    16
    Minecraft User:
    a9eelsh
    I am a novice at this
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What is novice?

    And if you don't know how to code, just request the plugin. This forum is to help you with the API, not to make you plugins. If you just want the plugins, go to the requests forum.

Share This Page

Advertisement