configuration/Item Formatting
Following are examples of the new formatting for items which will be used in MM 2.8+
Basic item example
First of all, case matters for item nodes, please keep everything in lower case.
Basic Nodes:
- type The bukkit name of the item. Bukkit item names can be found here. Item ID's will work but its better if you use item names. types is the only required node.
- damage The amount of damage on the item. This will create weapons/armour which are damaged or also create different versions of items. e.g. The golden apple, damage: 0 makes a normal golden apple, damage: 1 makes an enchanted golden apple.
- damage-max The maximum damage on the item. The damage will vary between damage and damage-max.
- amount The amount of this item to drop. Only used for DropSet
- amount-max The maximum amount of this item to drop. The amount will vary between amount and amount-max. Only used for DropSet
# Bare minimum for a golden apple type: GOLDEN_APPLE # Enchanted golden apple, with amount varying between 0 and 1 type: GOLDEN_APPLE damage: 1 amount: 0 amount-max: 1 # Random, either normal or enchanted golden apple type: GOLDEN_APPLE damage: 0 damage-max: 1
Adding Metadata
The remaining top level node for items is meta. The meta node will allow you to customise items more thoroughly.
When providing metadata you must have the meta node setup like the following example.
If a valid meta type is not specified the item will fail to be build.
At this time the following are valid meta types: UNSPECIFIC, BOOK, SKULL, LEATHER_ARMOR, MAP, POTION, ENCHANTED, FIREWORK and FIREWORK_EFFECT
Make sure the meta type is written in all capitals.
type: <ItemName or ID> meta: ==: ItemMeta meta-type: <Meta Type>
UNSPECIFIC Metadata
The UNSPECIFIC meta-type can be used for any item and provides nodes to allow you to set the display name, enchants, lore and repair cost.
All other meta-type's contain the same nodes as UNSPECIFIC along with their own ones.
UNSPECIFIC nodes:
- meta-type Used to specify the type of metadata. If meta is used and this is not given the item will be invalid. For basic items, just set it to UNSPECIFIC
- display-name Gives the item a display name. You can use & colour codes to colour the items name.
- lore Adds lore to the item. Up to 4 lines can be added to lore. You can use & colour codes to colour the items lore.
- enchants Enchants applied to the item. You apply enchants by writing as a sub-node, the name of the enchant then the level of the enchantment. See here for enchantment names.
- repair-cost This shows up after enchanting items, it increases the cost of repairing an item on an anvil.
# Renamed Diamond Shovel type: DIAMOND_SHOVEL meta: ==: ItemMeta meta-type: UNSPECIFIC display-name: '&aShadowDog''s Shovel' # Note that if you use & at the front of a string you have to surround the string in quote marks. # Enchanted Diamond Shovel type: DIAMOND_SHOVEL meta: ==: ItemMeta meta-type: UNSPECIFIC display-name: ShadowDog's Unbreaking Shovel enchants: DURABILITY: 3 # Enchanted Diamond Shovel with lore type: DIAMOND_SHOVEL meta: ==: ItemMeta meta-type: UNSPECIFIC display-name: ShadowDog's Unbreaking Shovel lore: - ShadowDog's diamond shovel is the - best of its kind - Never has man seen such a shovel enchants: DURABILITY: 3
BOOK Metadata
The BOOK meta-type can only be used for two items; BOOK_AND_QUILL and WRITTEN_BOOK.
It is used to set the books title and author, also to set the contents of each page.
BOOK nodes:
- title Used to specify the title of the book. Probably should only use this for written books. You can use & colour codes to colour the title.
- author Used to specify the author of the book. Probably should only use this for written books. You can use & colour codes to colour the authors name.
- pages List of contents of each page. Each page can not contain more than 256 characters else it will be truncated. You can use & colour codes to colour parts of the books pages.
# A book and quill type: BOOK_AND_QUILL meta: ==: ItemMeta meta-type: BOOK pages: - 'Testing. Testing.' - '1 2 3' # A written book type: WRITTEN_BOOK meta: ==: ItemMeta meta-type: BOOK title: Tests author: ShadowDog007 pages: - 'Testing. Testing.' - '1 2 3'
SKULL Metadata
The SKULL meta-type is used to set the owner of a player skill/head.
SKULL nodes:
- skull-owner Used to specify which players skin to use to texture the skull
# My friends head :) type: SKULL_ITEM meta: ==: ItemMeta meta-type: SKULL display-name: ShadowDog007's Victim skull-owner: drakoman5
LEATHER_ARMOR Metadata
The LEATHER_ARMOR is used to colour (wait for it) leather armour.
LEATHER_ARMOR nodes:
- color Used to set the colour of a piece of leather armour. Has 3 sub-nodes: RED, GREEN and BLUE. The sub-nodes represents an RGB colour. Each sub-node takes a value between 0-255 to control the amount of red/green/blue in the final colour. Go here and take the R, G and B values to select your colour.
# Red Leather Chestplate type: LEATHER_CHESTPLATE meta: ==: ItemMeta meta-type: LEATHER_ARMOR color: ==: Color RED: 255 GREEN: 0 BLUE: 0 # Green Leather Chestplate type: LEATHER_CHESTPLATE meta: ==: ItemMeta meta-type: LEATHER_ARMOR color: ==: Color RED: 0 GREEN: 255 BLUE: 0 # Blue Leather Chestplate type: LEATHER_CHESTPLATE meta: ==: ItemMeta meta-type: LEATHER_ARMOR color: ==: Color RED: 0 GREEN: 0 BLUE: 255 # Purple Leather Chestplate type: LEATHER_CHESTPLATE meta: ==: ItemMeta meta-type: LEATHER_ARMOR color: ==: Color RED: 127 BLUE: 178 GREEN: 63
MAP Metadata
The MAP meta-type is used to determine if the map has scaling? It seems to be set to true for all maps, but I am not sure.
Maps can be chosen by setting the damage on the map. If you know the map ID you want, set the damage to that ID and thats the map you will get.
MAP nodes:
- scaling Not sure what this means, but for valid maps, it seems to always be true.
# Map #1 type: MAP damage: 1 meta: ==: ItemMeta meta-type: MAP scaling: true # Map #7 type: MAP damage: 7 meta: ==: ItemMeta meta-type: MAP scaling: true
POTION Metadata
The POTION meta-type is used to create custom potions.
Normal potions can be created by just setting the damage of a POTION. Go here for more information.
POTION nodes:
- amplifier The level of the potion effect.
- ambient If true particle effects are shown when players are effected by the potion. Particle effects don't show if this is set to false.
- duration The duration in ticks that the potion effect will last. 20 ticks is one second.
- custom-effects A list of the custom potion effects.
custom-effects nodes:
- amplifier Same as above but applied to this specific effect.
- ambient Same as above but applied to this specific effect.
- duration Same as above but applied to this specific effect.
- effect The effect which is applied upon this potions use. For potion effect id's go here
# Normal potion (Potion of Strength) type: POTION damage: 8265 # Normal potion (Splash potion of Swiftness) type: POTION damage: 16450 # Splash potion of 'Infinite' Swiftness type: POTION damage: 16386 meta: ==: ItemMeta meta-type: POTION display-name: Splash potion of Infinite Swiftness custom-effects: - ==: PotionEffect effect: 1 duration: 999999999 amplifier: 2 ambient: true
ENCHANTED Metadata
The ENCHANTED meta-type is used to store enchantments in ENCHANTED_BOOK's.
ENCHANTED nodes:
- stored-enchants Used to select enchantments which are stored in the enchanted book. Format is the same as normal enchantments.
# Durability III enchanted book type: ENCHANTED_BOOK meta: ==: ItemMeta meta-type: ENCHANTED stored-enchants: DURABILITY: 2
More coming soon.
Comments