public function onEnable(): void { BlockFactory::registerBlock(new Anvil(), true); BlockFactory::registerBlock(new EnchantmentBlock(), true); $this->getServer()->getPluginManager()->registerEvents(new EventListener(), $this); } }
Just registering the block itself won't make the whole thing function. You'll need to implement the vanilla features that aren't implemented in PocketMine yourself
I'm using the vanillaX console plugin and it gives me an error in this line of code I don't understand
[22:35:44.484] [Server thread/INFO]: Enabling VanillaInventory v1.1.2 [22:35:44.485] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\block\BlockFactory::registerBlock()" (EXCEPTION) in "plugins/VanillaInventory-main/src/korado531m7/VanillaInventory/Main" at line 22 --- Stack trace --- #0 pmsrc/src/plugin/PluginBase(137): korado531m7\VanillaInventory\Main->onEnable() #1 pmsrc/src/plugin/PluginManager(437): pocketmine\plugin\PluginBase->onEnableStateChange(true) #2 pmsrc/src/Server(1385): pocketmine\plugin\PluginManager->enablePlugin(object korado531m7\VanillaInventory\Main#25216) #3 pmsrc/src/Server(1011): pocketmine\Server->enablePlugins(object pocketmine\plugin\PluginEnableOrder#24900) #4 pmsrc/src/PocketMine(304): pocketmine\Server->__construct(object BaseClassLoader#2, object pocketmine\utils\MainLogger#3, string[46] C:\Users\thgna\OneDrive\M..y t..nh\pocketmine\, string[54] C:\Users\thgna\OneDrive\M..y t..nh\pocketmine\plugins\) #5 pmsrc/src/PocketMine(327): pocketmine\server() #6 pmsrc(11): require(string[90] phar://C:/Users/thgna/OneDrive/M..y t..nh/pocketmine/PocketMine-MP.phar/src/Pock) --- End of exception information --- [22:35:44.485] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump [22:35:44.491] [Server thread/EMERGENCY]: Please upload the "C:/Users/thgna/OneDrive/Máy tính/pocketmine/crashdumps/Sat_Apr_16-22.35.44-WIB_2022.log" file to the Crash Archive and submit the link to the Bug Reporting page. Give as much info as you can.
I have fixed it, thanks. currently my new problem a lot of plugins encountered [Server thread/ERROR]: Could not load plugin 'C:\Users\thgna\Desktop\PocketMine-MP-stable\plugins\ITEM-ID-main': Invalid plugin manifest: Command id does not have a valid permission set
Code: --- name: ItemID version: 1.0.0 author: HasiyfGaming website: https://github.com/DerphSZ description: ItemID Plugin for PocketMine Server 1.16 - 1.17 Version main: hasiyfgaming\itemid\Main api: 4.0.0 commands: id: description: "ItemID commands" default: true ...
Try this one Code: --- name: ItemID version: 1.0.0 author: HasiyfGaming website: https://github.com/DerphSZ description: ItemID Plugin for PocketMine Server 1.16 - 1.17 Version main: hasiyfgaming\itemid\Main api: 4.0.0 commands: id: description: "ItemID commands" default: true permission: id.cmd permissions: id.cmd default: true ...