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

Declare $inv

Discussion in 'Development' started by bySentixPE, May 25, 2018.

  1. bySentixPE

    bySentixPE Spider Jockey

    Messages:
    37
    Sorry for my Bad english!
    I need your help! I have the line $player->addWindow($inv);
    How can i declare $inv? $inv must be the inventory of a workbench!
    Thanks!
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    I have not tested this, but it might work for you
    PHP:
            /** @var CraftingTable $table */
            
    $table Block::get(Block::CRAFTING_TABLE);
            
    /** @var Player $player */
            
    $player->getLevel()->setBlock($player->subtract(0,2), $tablefalsefalse);
            
    $table->onActivate(Item::get(Item::AIR), $player);
            
    $inv null;
            
    $player->addWindow($invContainerIds::INVENTORY);
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
  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.