I think PocketMine will provide API methods for that. You are doing the work too early. PocketMine has not completed comprehensible work on XP yet.