Ok so I made a new item extending Item. It is registered but when I do /give the item doesn't show in inventory but command goes through. Also when the item is in my inventory it becomes bugged and start shifting iterms in my inventory
powergem.php PHP: class powergem extends Item { public function __construct($meta = 0){ parent::__construct(560, $meta, "Power Gem"); } public function getCustomName() : String { return "Power Gem"; } public function getMaxStackSize() : int { return 16; } loader.php to register item PHP: ItemFactory::registerItem(new powergem(), true);
The item id has too be a item that is currently in mcbe, the id 560 doesn't exists in the games ids or even pmmps
I think there's a misunderstanding in what it means to construct an Item in PMMP. You can only create items that can be handled by the client, so you can't create items that don't exist in the game. You can, however, create your own Item class that contains different properties from the default in PMMP, or implement Items that are in MCBE but not in PMMP yet.
i did but it doesnt set the name of the new item i get an error saying cannot override final method pocketmine\item\Item::getName()