1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

addWindow

Discussion in 'Development' started by LucGamesDE, May 6, 2017.

  1. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    Hi. I tried to open the inv of another player using addWindow. But it isn't working
     
  2. xXNiceAssassinlo

    xXNiceAssassinlo Spider

    Messages:
    14
    GitHub:
    xXNiceAssassinlo
    It will not work the feature is not on in mcpe.
     
  3. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    addWindow works with chests!
     
  4. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Please be more descriptive. What code did you use? What did you expect to happen? Any errors/output? Have you tried debugging? Does it do anything at all?
     
  5. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    I does nothing. I defined the inventory $i. And tried to open it using $player->addWindow($i);

    No errors
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    How did you construct the inventory? What type of Inventory is it? There are several.
     
  7. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    $targetplayer->getInventory();
     
  8. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    are you trying to get a players inventory then add the players item into a chest? or open a chest?
     
  9. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    No... I want to open $targetplayer's inv to $player
     
  10. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    I don't know if it is possible to send a PlayerInventory to a non-corresponding Player, and I don't think many people have ever tried. Maybe you could create a CustomInventory class and have it duplicate the contents of the PlayerInventory?
     
  11. PocketKiller

    PocketKiller Slime

    Messages:
    83
    GitHub:
    iPocket
    You cannot open a player inventory from an action in server-side, It's not supported in MCPE or even MCPC.
    ^ as he said, also make unique slot positions for armour/arrow slots.
     
    corytortoise likes this.
  12. LucGamesDE

    LucGamesDE Baby Zombie

    Messages:
    170
    How can I create a chest tile and copy everything from $inv to the $tile->getInventory()
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.