Hello, I have a problem, i don't know how i can write or do a plugin for reparing items in hand and all in inventory please help me. Thank you. Don't say [learn php, learn pocketmine, download a plugin from github or pmmp] because it will don't help me thanks.
What about this, there are plugins on pmmp that have it, take a look at their code try it out and if it doesnt work report your problems here! I'll help you with your issues!
PHP: if(isset($args[0])){ if($args[0] == "all"){ foreach($sender->getInventory()->getContents() as $item) { if($item instanceof Tool) $item->setDamage(0); } foreach($sender->getInventory()->getArmorContents() as $item) { if($item instanceof Armor) $item->setDamage(0); } $sender->sendMessage("ยง7All of your items have been repaired!"); return true; } return true; } return true; } } } return true; }} it doen't work when i say /repair all PHP: Error: "Call to undefined method pocketmine\inventory\PlayerInventory::getArmorContents()" (EXCEPTION) in "plugins/repair/src/repair/Main" at line 657