Closed Ivanzar closed 9 years ago
sleep()
should basically never be used by plugins unless you have something to do with threads.
You can use a scheduler.
Also, $event
only refers to one move event. setCancelled
does not do anything except marking the event is cancelled. After your handler (and handlers from other plugins) finishes executing, PocketMine will check if the event is marked cancelled, if yes, revert the player motion. Using sleep()
will stop PocketMine from executing, and therefore will not do anything.
You should cancel the move event when the time is within that 10 seconds, and do nothing when the player can move.
timer Hi, I have a question. How to stop the player for some time, I use this code, but it does not work (