Serializable Item¶
We often need to reference an item in Geary, usually through our own SerializableItemStack. The item may inherit from other plugins or be configured in-place (ex referencing another prefab in a recipe, or defining the item itself.)
All properties are optional, setting a property will override the vanilla value, below is an example of all properties:
# You may use a vanilla item or inherit from another item system
type: stone # (1)!
prefab: <string> # (2)!
crucibleItem: <string>
oraxenItem: <string>
itemsadderItem: <string>
# Override item properties
amount: 2
customModelData: 42
displayName: "<bold><red>Fancy stone" # (3)!
lore:
- "Lore line 1"
- "<red>Formatted line 2"
unbreakable: false
damage: 0
enchantments:
- enchant: minecraft:sharpness # (4)!
level: 3
itemFlags: [ HIDE_ENCHANTS ] # (5)!
attributeModifiers:
- attribute: GENERIC_ATTACK_DAMAGE # (6)!
modifier:
name: customAttribute
amount: 1.0
operation: ADD_NUMBER # (7)!
potionData:
type: REGEN # (8)!
extended: true
upgraded: true
color: '#fffff' # (9)!
knowledgeBookRecipes: [ "minecraft:gold_ingot_from_nuggets" ] # (10)!
- Vanilla item type, may be prefixed with
minecraft:
or written in all caps, ex:minecraft:stone
orSTONE
- Geary prefab to read item off of. Must itself have a
geary:set.item
component - All text lines support MiniMessage formatting
- Minecraft namespaced key for an enchant.
- List of ItemFlag values
- Attribute to modify
- Type of operation (add, multiple, etc), see AttributeModifier.Operation
- Potion type, see PotionType
- Potion color, in the form
#RRGGBB
orr, g, b
with 0-255 values - List of recipes to unlock in a knowledge book, use Minecraft namespaced keys for recipes.