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

add a chest inventory window to play while he is in chest

Comments in 'Plugin Development' started by AvivShopenCraft, Jun 24, 2016.

  1. AvivShopenCraft
    Offline

    AvivShopenCraft New Member

    Joined:
    Oct 14, 2015
    Posts:
    73
    Minecraft User:
    AvivShopen
    Hi, im trying to add a chest inventory to a player while he is in a chest inventory, but every time i do that, when a player moves to the other chest, the first chest stays open and i cant open it using addWindow() again, i tried removeWindow($firstchest->getInventory()) with no success, any help?
  2. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    PHP:
    $player //player object;
    $player->removeWindow($firstchest->getInventory());
    //or this maybe
    $chestTile $this->getServer()->getLevelByName("world")->getTile(new Vector3($xOfChest$yOfChest$zofChest));
    $chestTile->close();
    Last edited: Jun 24, 2016
  3. AvivShopenCraft
    Offline

    AvivShopenCraft New Member

    Joined:
    Oct 14, 2015
    Posts:
    73
    Minecraft User:
    AvivShopen
    ill try that out
  4. AvivShopenCraft
    Offline

    AvivShopenCraft New Member

    Joined:
    Oct 14, 2015
    Posts:
    73
    Minecraft User:
    AvivShopen
    its not removing the chest inventory window.. but it does close the chest
  5. AvivShopenCraft
    Offline

    AvivShopenCraft New Member

    Joined:
    Oct 14, 2015
    Posts:
    73
    Minecraft User:
    AvivShopen
    oh lol i forgot to addWindow again, now it does open the other chest but the first chest stays open, i will try to add task that waits 2 seconds before moving(to let the first chest close first)

Share This Page

Advertisement