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!
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), $table, false, false); $table->onActivate(Item::get(Item::AIR), $player); $inv = null; $player->addWindow($inv, ContainerIds::INVENTORY);