Changes between Initial Version and Version 1 of olivine/dsl/types/item


Ignore:
Timestamp:
May 22, 2020 12:09:13 AM (4 years ago)
Author:
jonathan
Comment:

Page introduction

Legend:

Unmodified
Added
Removed
Modified
  • olivine/dsl/types/item

    v1 v1  
     1= Game Items =
     2Visit [wiki:olivine/dsl/types/core core types] for information on primitive and core types such as `integer`.
     3
     4An `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.
     5
     6Here 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:
     7
     8{{{
     9   item &stone
     10}}}
     11
     12Suppose there is another resource group that the `stone` item but you want the ''Minecraft'' one, here's how you express that:
     13
     14{{{
     15   item &minecraft:stone
     16}}}
     17
     18== Attributes ==
     19You 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:
     20
     21||= Name =||= Type =||= Description =||
     22||name||text||Custom name of the item||
     23||description||text||The ''lore'' of the item (that's just a fancy name for a custom description of the item)||
     24||enchantments||list of [wiki:olivine/dsl/attribs/enchantment enchantment]||The list of enchantments the item should have||
     25||color||[wiki:olivine/dsl/types/color color]||Color of the item, only applies to leather armor right now||
     26||modifiers||[#=itemmodifiers item modifiers]||Item-specific modifiers, click the ''item modifiers'' link for more information||
     27||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||
     28
     29=== Item Modifiers ===
     30All these are [wiki:olivine/dsl/attribs/modifier 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.
     31 * `health` - 'nuff said
     32 * `stability` - Knockback resistance
     33 * `agility` - Movement / run speed
     34 * `strength` - Attack damage dealt
     35
     36== Examples ==
     37Here's an item with attributes including enchantments and a modifier:
     38{{{
     39item &mmm:darksteel_leggings with {
     40    name -> "Me pants!"
     41    description -> "Git yer own pants! these be mine!"
     42    enchantments -> [
     43        { type -> fire_protection; level -> 3 }
     44        { type -> unbreaking; level -> 3 }
     45    ]
     46    modifiers -> {
     47        health -> { amount -> 2; operator -> boost }
     48    }
     49}
     50}}}