Hey guys, is this possible to use? PHP: $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "give ".$name." paper 1 {display:{Name:"§r§6§lMedal"},Unbreakable:1}");
Obviously this does not work according to the syntax highlighting from the forums. http://php.net/manual/en/language.types.string.php#language.types.string.syntax.double
PHP: $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "give ".$name." paper 1 {display:{Name:§r§6§lMedal},Unbreakable:1}");
Oh no setCustomName is available in the class Item. So $item must be instanceof Item Exemple PHP: $id = 4; // The id of the item$item = Item::get($id,0,2);$item->setCustomName("test");#To dont have error check if player is an instanceof Player$sender->getInventory()->addItem($item);
I rather not use dispatch lol use this PHP: $item = Item::get(Item::PAPER);$item->setCustomName("§6§lMedal");$player->getInventory()->addItem($item);