what would be the code to add an item in someone's inventory and the items would be an item with a ':' e.g. 159:5 and 159:14 and how would it be possible to set these two items in the hotbar? for the adding, I tried $pl->getInventory()->addItem(new Item(159:5, 0 ,1)); but when server starts it shows unexpected ':'
The second parameter stands for it damage value on Item::get, so the code is $player->getInventory()->addItem(Item::get(159, 5, 1));
This justifys @MyNameIsTriXz answer but with what the parameters mean. $player->getInventory()->addItem(Item::get(ID, DAMAGE, AMOUNT));
BTW, if you are thinking of getting values out of a string "123:1:1", you can use PHP: $data = explode(':', "113:1:1");$item = Item::get($data[0], $data[1], $data[2]); More info on the PHP manual.