Hello, How to add SetCustomName() on addItem()? PHP: $p->getInventory()->addItem(Item::get(261,0,1));
As SuperMaXAleX said^ Just for reference in the future since it seems your new to PMMP API PlayerInventory/BaseInventory class functions such as addItem() removeItem(), etc, the parameter is anything that's instanceof Item. So you can create a variable then construct an Item as the value using PHP: $item = Item::get({item_id}, {item_damage}, {item_count}); Then once you have the variable holding the value of that Item instance, you can run any of the functions under Item::class, such as setCustomName(), addEnchantment(), etc. Then add the $item under the functions listed above, addItem(), removeItem(), etc. PHP: $player->getInventory()->addItem($item);
PHP: $item = Item::get(1,0,1);$item->setCustomName("The\nMagic\nStone");$player->getInventory()->addItem($item);