menu
#9718459 Call to a member function setCustomName() on null

Submitted by PocketMine-MP 5.8.2

General information

Version: 5.8.2
Git commit: c3c81b09
Plugin involvement: Direct
Report date: 2023-12-03 04:09:02 +0000 UTC
Server uptime: 0 days 0 hours 0 minutes 1 seconds

System Information

PHP version: 8.1.26
JIT status: Not available
Operating system: linux
System banner: Linux c371c298-4e29-4457-88d9-82f1fd3505b2 6.2.0-1016-azure #16~22.04.1-Ubuntu SMP Tue Oct 10 17:11:51 UTC 2023 x86_64

Error information

Warning: the PiggyCrates plugin was directly involved in this crash. Please contact the plugin author.
Thread: Main
Message: Call to a member function setCustomName() on null
File: plugins/PiggyCrates/src/DaPigGuy/PiggyCrates/PiggyCrates
Line: #107
Type: Error
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
                }
try {
$item = StringToItemParser::getInstance()->parse($itemData["id"] . ":" . $itemData["meta"])?->setCount((int) $itemData["amount"]) ?? LegacyStringToItemParser::getInstance()->parse($itemData["id"] . ":" . $itemData["meta"])?->setCount((int) $itemData["amount"]);
}catch(LegacyStringToItemParserException $e){
echo $e->getMessage();
}
if($tags !== null) {
$item->setNamedTag($tags);
}
if (isset($itemData["name"])) $item->setCustomName($itemData["name"]);
if (isset($itemData["lore"])) $item->setLore(explode("\n", $itemData["lore"]));
if (isset($itemData["enchantments"])) foreach ($itemData["enchantments"] as $enchantmentData) {
if (!isset($enchantmentData["name"]) || !isset($enchantmentData["level"])) {
$this->getLogger()->error("Invalid enchantment configuration used in crate " . $crateName);
continue;
}
$enchantment = StringToEnchantmentParser::getInstance()->parse($enchantmentData["name"]);
if ($enchantment !== null) $item->addEnchantment(new EnchantmentInstance($enchantment, $enchantmentData["level"]));
}
$itemData["type"] = $itemData["type"] ?? "item";
#0 (): DaPigGuy\PiggyCrates\PiggyCrates->DaPigGuy\PiggyCrates\{closure}(array[7])
#1 plugins/PiggyCrates/src/DaPigGuy/PiggyCrates/PiggyCrates(123): array_map(object Closure#202970, array[32])
#2 pmsrc/src/plugin/PluginBase(119): DaPigGuy\PiggyCrates\PiggyCrates->onEnable()
#3 pmsrc/src/plugin/PluginManager(454): pocketmine\plugin\PluginBase->onEnableStateChange(true)
#4 pmsrc/src/Server(1391): pocketmine\plugin\PluginManager->enablePlugin(object DaPigGuy\PiggyCrates\PiggyCrates#63615)
#5 pmsrc/src/Server(1034): pocketmine\Server->enablePlugins(object pocketmine\plugin\PluginEnableOrder#44784)
#6 pmsrc/src/PocketMine(341): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[16] /home/container/, string[24] /home/container/plugins/)
#7 pmsrc/src/PocketMine(364): pocketmine\server()
#8 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed Composer Dependencies

Installed PHP Extensions

  • Show