-
Notifications
You must be signed in to change notification settings - Fork 4
Items
Psycofeu edited this page May 3, 2025
·
6 revisions
class MyItem extends Item
{
public function __construct(string $name, string $id)
{
parent::__construct(new ItemIdentifier($id, ItemTypeIds::newId()), $name);
}
public function getItemBuilder(): ItemBuilder
{
return parent::getItemBuilder()
->setIcon("mytexture")
->addComponent(new DisplayNameComponent($this->getVanillaName()))
->setCreativeInfo(new ItemCreativeInfo(CategoryCreativeEnum::ITEMS, GroupCreativeEnum::CHEST));
}
}SymplyItemFactory::getInstance()->register(static fn() => new MyItem("My Item", "symply:myitem"));class Helmet extends Armor
{
public function __construct(ItemIdentifier $identifier, string $name, ArmorTypeInfo $info) {
parent::__construct($identifier, $name, $info, [ItemEnchantmentTags::ARMOR]);
}
public function getItemBuilder(): ItemBuilder {
return parent::getItemBuilder()
->setCreativeInfo(new ItemCreativeInfo(CategoryCreativeEnum::EQUIPMENT, GroupCreativeEnum::HELMET))
->setIcon("exemple_helmet")
}
}