Version 1 (modified by jonathan, 4 years ago) (diff) |
---|
Game Items
Visit core types for information on primitive and core types such as integer.
An item expresses a named game item. It is comprised of two parts, the resource group name and the sub-name. The syntax takes one of the two forms: item &group:name or item name where group is the resource group name and name is the name of the item in that resource group. As you may notice, the second form doesn't specify the group, that is because it is optional. If the item is descriptive enough on it's own then Olivine will find it, however, if there is more than one item loaded with the same name (but exist in separate resource groups) then you would use the first syntax approach to be more definitive and mitigate ambiguity.
Here is a simple example that expresses an item by name without a resource group, this will cause Olivine to go looking for it in all loaded resource groups:
item &stone
Suppose there is another resource group that the stone item but you want the Minecraft one, here's how you express that:
item &minecraft:stone
Attributes
You can also tack-on attributes to your item definition, the syntax is either item &group:name with attributes or item &name with attributes where attributes is described as a dictionary in the table below:
Name | Type | Description |
---|---|---|
name | text | Custom name of the item |
description | text | The lore of the item (that's just a fancy name for a custom description of the item) |
enchantments | list of enchantment | The list of enchantments the item should have |
color | color | Color of the item, only applies to leather armor right now |
modifiers | item modifiers | Item-specific modifiers, click the item modifiers link for more information |
wear | integer | How worn the item is, this isn't how damaged it is but how much it costs to repair it when it becomes damaged |
Item Modifiers
All these are modifier definitions, click on the link for information on how to define one. These modifiers affect the mob or player holding this item in their hand.
- health - 'nuff said
- stability - Knockback resistance
- agility - Movement / run speed
- strength - Attack damage dealt
Examples
Here's an item with attributes including enchantments and a modifier:
item &mmm:darksteel_leggings with { name -> "Me pants!" description -> "Git yer own pants! these be mine!" enchantments -> [ { type -> fire_protection; level -> 3 } { type -> unbreaking; level -> 3 } ] modifiers -> { health -> { amount -> 2; operator -> boost } } }