Code: private function registerItem() { foreach (Item::getCreativeItems() as $item) { if ($item !== null) { Item::getCreativeItems()[Item::FILLED_MAP ?? 358] = is_string($item) ? FilledMap::class : new FilledMap(); break; } } }
Spoiler: ERROR 2017-12-18 [09:02:41] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump 2017-12-18 [09:02:41] [Server thread/EMERGENCY]: Please upload the "C:\Users\Brian\Desktop\Znation Network\Server\crashdumps/Mon_Dec_18-09.02.41-CST_2017.log"
Spoiler: crash BAD PLUGIN: ZnationCore v0.0.8 Code: [72] 'x_block' => $x_block, [73] 'y_block' => $y_block [74] ]); [75] } [76] [77] public function getMaxStackSize() : int { [78] return 1; [79] } [80] [81] }
First of all, you should give the actual error. You've showed us your code, you've showed where the error occures, but not what the error is. That's not very useful. Anyway, I'm not sure why you're using such a weird item to register an item, but you could just use the following method to add an item to the creative inventory: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/item/Item.php#L144-L146
Code: private function registerItems() { Item::addCreativeItem([Item::FILLED_MAP ?? 358] ? FilledMap::class : new FilledMap()); } it could work? Code: Item::addCreativeItem(FilledMap::get(358, 0, 1));
To register an item, use this static function: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/item/ItemFactory.php#L274