Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.
Matt edited this page Aug 14, 2021 · 2 revisions

Welcome to the Templates wiki!

Templates currently provides two main formats:

Template [source] AKA "SanctumTemplate" via ConfigurationSerializable

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.