Why task start run from 1 and then 21, 41, and so on? Should'nt it run like from 0 or 20, then 40, 60, 80, and so on? I'm just trying to make some calculation with $currentTicks and Math method there.
no code no help make sure you set it at construct make sure you arent new-ing the instance so it reset
Plugins are not guaranteed to start at server start. They may start when the server has been running for a while. When the server is starting up, the tick is 0. When a task is scheduled, it is only checked to be run on the first tick (that is, tick 1). If you schedule a repeating task when the server is already running (tick != 0), scheduling a repeating task will execute the task in the same tick (potentially resulting in an infinite loop).
Another way of viewing it is to treat ticks as "PocketMine timestamps". Just like when you work with Unix timestamps, you are only interested in the current timestamp and the difference of some stored timestamp from the current timestamp, and you won't really care about when the Unix timestamp epoch was dated.