Closed supercrafter333 closed 3 years ago
My Code:
if (class_exists(CustomItemLoader::class)) { $copperItem = new CustomItem("Block of Copper", [ "id" => 255 - $copperblock->getId(), "meta" => 0, "namespace" => "minecraft:copper_block", "name" => $copperblock->getName(), "texture" => "block_of_cooper.png" ]); CustomItemManager::registerItem($copperItem); CustomItemManager::init(); }
Error:
[18:54:48] [Server thread/CRITICAL]: Error: "Call to a member function setValue() on null" (EXCEPTION) in "plugins/CustomItemLoader/src/alvin0319/CustomItemLoader/CustomItemManager" at line 109 [18:54:48] [Server thread/CRITICAL]: #0 plugins/CustomItemLoader/src/alvin0319/CustomItemLoader/CustomItemManager(105): alvin0319\CustomItemLoader\CustomItemManager::refresh() [18:54:48] [Server thread/CRITICAL]: #1 plugins/MissingBlockX/src/supercrafter333/MissingBlockX/MissingBlockX(417): alvin0319\CustomItemLoader\CustomItemManager::registerItem(object alvin0319\CustomItemLoader\item\CustomItem) [18:54:48] [Server thread/CRITICAL]: #2 pmsrc/src/pocketmine/plugin/PluginBase(116): supercrafter333\MissingBlockX\MissingBlockX->onEnable() [18:54:48] [Server thread/CRITICAL]: #3 pmsrc/src/pocketmine/plugin/PluginManager(552): pocketmine\plugin\PluginBase->setEnabled(boolean 1) [18:54:48] [Server thread/CRITICAL]: #4 pmsrc/src/pocketmine/Server(1785): pocketmine\plugin\PluginManager->enablePlugin(object supercrafter333\MissingBlockX\MissingBlockX) [18:54:48] [Server thread/CRITICAL]: #5 pmsrc/src/pocketmine/Server(1771): pocketmine\Server->enablePlugin(object supercrafter333\MissingBlockX\MissingBlockX) [18:54:48] [Server thread/CRITICAL]: #6 pmsrc/src/pocketmine/Server(1584): pocketmine\Server->enablePlugins(integer 1) [18:54:48] [Server thread/CRITICAL]: #7 pmsrc/src/pocketmine/PocketMine(291): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[11] /home/DevX/, string[19] /home/DevX/plugins/) [18:54:48] [Server thread/CRITICAL]: #8 pmsrc/src/pocketmine/PocketMine(321): pocketmine\server() [18:54:48] [Server thread/CRITICAL]: #9 pmsrc(11): require(string[63] phar:///home/DevX/pocketmine.phar/src/pocketmine/PocketMine.php)
Try init CustomItemManager before registering item.
Closing due to no response
My Code:
Error: