PHP: /** @var Player $player */ $player->level->removeTile($player->level->getTile($player->subtract(0, 1))); In practice, you would want to confirm that there is a tile below the player before trying to remove it, or you may get an error. (source)
If you have a Chest tile, you can get the Inventory from it and do whatever you would typically do with a ChestInventory. (source)