Hello, I am looking for a plugin to change attribute of an items. For example : I want a bone to deal 10 attack damage. Thank you in advance
2 ways : 1. extract pocketmine with devtools and edit it then make it phar with devtools 2. download pocketmmine mp config from github then make it phar with devtools and put it in you folder
PHP: public function onDamage(EntityDamageEvent $event){ if($event->getEntity() instanceof Player){ $player = $event->getEntity(); if($player->getInventory()->getItemInHand()->getId() === Item::BONE){ $event->setBaseDamage(10); } }}
PHP: public function onDamage(EntityDamageEvent $event){ $player = $event->getEntity(); if($player instanceof Player){ if($player->getInventory()->getItemInHand()->getId() === Item::BONE) { $event->setBaseDamage(10); } }} If you use just 1 = , return is always true