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

Solved Ticks VS Seconds

Comments in 'Plugin Development' started by ImagicalGamer, Jul 21, 2016.

  1. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    I have a question about Ticks vs Seconds. Obviously 20 ticks or so are in a second but when scheduling tasks (in plugins) should I set the time as (20 * 1) = 1 sec or just (1)? Does PocketMine convert to seconds or should I go based off of ticks?
  2. Yeelze
    Offline

    Yeelze New Member

    Joined:
    Apr 2, 2016
    Posts:
    31
    Minecraft User:
    Yeelze
    1*20, it will run every second if you are using a RepeatingTask.
    ImagicalGamer likes this.
  3. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Yea, 20 ticks = 1 sec.
    You need to use ticks. Though, why 20 * 1? Just use 20.
    hoyinm14mc likes this.
  4. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    Easier to do 20 * $mySec than irl multiply 20 by $mySec.
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    So it's easier to calculate 20 * 1 instead of then just use 20?
  6. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    If I was gonna use 1 second I would just do 20 but most of the time it's more than one second.
  7. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Well, we were actually talking about your question, which was basically saying 1 second. We weren't talking about "most of the time".
  8. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    I apologize for not being more specific and applying my situation to all cases.
  9. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    {{Citation needed}}
    (I know it is true, but it is fun to find some citation here)

Share This Page

Advertisement