Error: PHP: [22:06:17] [Server thread/CRITICAL]: Could not pass event 'pocketmine\event\block\BlockBreakEvent' to 'MineReward v1': Call to a member function getName() on integer on a\a[22:06:17] [Server thread/CRITICAL]: Error: "Call to a member function getName() on integer" (EXCEPTION) in "Mine-Reward-master/src/a/a" at line 32 Line 32 PHP: $itemname = $this->getConfig()->get("item")->getName(); Config PHP: item: 388 Already thank for support
To get an items name you must do $item->getName() , int isn't an item so first your going have to make it into an item! Item::get() ( https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/item/Item.php#L99 ) PHP: $item = Item::get(id, meta = 0, count = 1); PHP: $item->getName();
I m know and agree but in this plugin i use config. I need to know item name to send this last one in message
Once you have returned the Item in the config, which is an Id ofc, you need to make it into a Item , Item::get() does that!