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

Empty $player->windows?

Comments in 'Plugin Development' started by PEMapModder, Jul 17, 2015.

  1. PEMapModder

    PEMapModder Notable Member Plugin Developer

    Oct 9, 2013
    Minecraft User:
    On the LegionPE Theta test server ( I found that players don't receive their kits. Further testing found /give not working either.

    I used PacketLogger to log the ContainerSetContentPacket, and the result is that the main inventory (not armor inventory) is sent as creative inventory instead, which MCPE probably ignored.

    Therefore, I browsed through the PocketMine internal code. It seems that PlayerInventory tries to send inventory by the $player->getWindowId($playerInventory) method, which, according to PacketLogger, returns 0x79 (the creative inventory window ID). I therefore used reflections to dump the values of $player->windows seeing that getWindowId depends on it, and found it to be an empty SplObjectStorage.

    In vanilla servers, I have tested and confirmed that normally $player->windows should have at least a PlayerInventory filled in it.

    I am wondering what I have done wrong in my plugin? You can see the plugin source at

    Edit: I have tested and known that the SplObjectStorage is already empty in PlayerLoginEvent.

    Also, please, if you have the faintest idea why this happens, please reply. I have spent hours on it and still hadn't found out why.
    jojoe77777 and Andrey Nazarchuk like this.

Share This Page