-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Templates currently provides two main formats:
This class is perfect for applying simple edits to any item!
You can specify:
- Display name
- Lore
- Item amount
- Enchantments and their levels
- ItemFlags you wish to add
- ItemFlags you wish to remove
Logic involving more sophisticated metadata can be processed with MetaTemplate.
MetaTemplate and SimpleMetaTemplate [source] AKA "SanctumMetaTemplate" via ConfigurationSerializable
This class enables you to store a Material-ItemMeta state pair for later composition with a Template.
For example, you might have code that produces player heads (items with unique meta). If the item is fairly common and a good candidate for configurability (such as if said heads are navigation buttons in a menu), these classes allow you to store those items to config quite succinctly.
Material and ItemMeta are preserved. Calling MetaTemplate#compose(Template)
produces a new ItemStack, applies the MetaTemplate's ItemMeta and then applies any additional styles requested by the given Template.