https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/entity/Human.php#L214-L236 use these functions
$player->sendMessage("§7• >drOP:trafiłeś na rudę złota§b(+40xp)"); $player->getInventory()->addItem(Item::get(14, 0, 1)); $this->attributeMap->getAttribute(Attribute::EXPERIENCE)->getValue(40); } should work ?
i added that and seems error: [Server thread/CRITICAL]: InvalidArgumentException: "Value 20 exceeds the range!" (EXCEPTION) in "/src/pocketmine/entity/Attribute" at line 175 Btw: Its still dont sending me messages for example i drop diamond and i see Chat are sized up but i dont see message , and what i started seen too im not droped all items what i want to drop is me have error in percentage chance of drop ?
Should i add mt_rand to each single block for example PHP: public function onBreak(BlockBreakEvent $e){ $player = $e->getPlayer(); $block = $e->getBlock(); $gracz = $e->getPlayer()->getName(); $drop = mt_rand(1,1000);if($e->getBlock()->getId() == 1) { switch($drop){ if($drop <= 50) /* it means 5% chance to do it ? for example 5% to drop id 2 from stone*/ $player->getInventory()->addItem(Item::get(2, 0, 0));break; if($drop <= 500) /* it means 50% chance to do it ? for example 50% to drop id 3 from stone */ $player->getInventory()->addItem(Item::get(3, 0, 0)); } }}