Code: public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) :bool { switch ($cmd->getName()) { case "test": $item = Item::get(1, 0, 64); // id, meta, count $sender->getInventory()->addItem($item); //add item to player $sender->sendMessage("You got 64 stones!"); // message break; } return true; } I hope it helped you
Hello, use : PHP: //onCommand Functioncase "GodWeedZao":$player->getInventory()->addItem(2, 0, 10);//now adding 10 Stone Block in your inventorybreak;return true; SOLVED?