Try saving the player uuid (or simplier the name) in an array, than on player move you check if he's uuid (or name) it's in the array and cancel the event
Why his uuid, just his pseudo. You can use the move event but it is not recommended, it uses a lot of resources
Not recommended by who? Handling the PlayerMoveEvent is the most precise way to deal with movements. Events are almost being called even if you haven't registered the listener, nothing bad in handling it. The immobile flag is currently not being handled by pocketmine so it's going to have the same effect as telling a robber not to rob a store and trusting the robber with your word. You could add PHP: if($player->isImmobile()){ $event->setCancelled();} in PlayerMoveEvent though.