Hello, I've made a start on a Crate plugin at the moment I'm working on the recievement of a crate key. Questions) How to use the items add id setup? How to name a custom item? And how to use a $ parentheses that will be dependent on what argument is stated in the comman eg. /Crate common (gives common key) /crate rare etc.
Hello. I see you are using a online tool for php, but why don’t you use a text editor or IDE? I suggest brackets.io. That is what I use, and it formats the code so it’s easier to understand (by the colour of the code) Alternatively, use Notepad++
Funny enough I am using notepad++. Those pictures were when I was trying to test it on a server.pro thing, I couldn't find the latest pocketmine version to test it on, so I alternatively used a cheap option. but I'll have a look at upgrading to brackets.io. Cheers,
PHP: $item = Item::get(Id, damage, count);$player->getInventory()->addItem($item);One Line$player->getInventory()->addItem(Item::get(Id, Damage, Count));$item = Item::get(Id, damage, count);$item->setCustomName("string");$player->getInventory()->addItem($item);One Line$player->getInventory()->addItem(Item::get(Id, damage, count)->setCustomName("string")); just incase your new to the PMMP API https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/item/Item.php also remember to add \pocketmine\item\Item