mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-20 14:32:15 +01:00
Updated Item and Reward Syntax (markdown)
parent
3437811c71
commit
42976cc1ed
@ -10,74 +10,57 @@
|
||||
|
||||
### An Overview
|
||||
|
||||
Items in MobArena follow a very specific syntax that you **must** obey, or you will experience missing items or errors. Be attentive to the details, because if you aren't, there will be consequences.
|
||||
|
||||
MobArena allows these three different ways of defining items:
|
||||
Items in MobArena follow a very specific syntax that you **must** follow, or you will experience missing items or errors. MobArena allows these three different ways of defining items:
|
||||
|
||||
Single: [<id>|<name>]
|
||||
Multiple: [<id>|<name>]:<amount>
|
||||
Sub-types: [<id>|<name>]:<data>:<amount>
|
||||
Single: <id>
|
||||
Multiple: <id>:<amount>
|
||||
Sub-types: <id>:<data>:<amount>
|
||||
|
||||
Confusing? Let's break them down one by one.
|
||||
|
||||
### 1. Single Items
|
||||
|
||||
[<id>|<name>]
|
||||
<id>
|
||||
|
||||
This means you can use either the item ID (`<id>`), or the item name (`<name>`) as defined in the [Material enum of the Bukkit API](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html). The item names are case-insensitive.
|
||||
If all you want is one of an item, you can simply refer to its ID. MobArena only officially supports string IDs, which can be found in the [Material enum of the Bukkit API](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html). The item names are case-insensitive, but the underscores are important.
|
||||
|
||||
Note that the Material enum changes when there are new items or sometimes if items were reworked. As an example, the `SPLASH_POTION` enum value is not available in versions prior to Minecraft 1.9. Before then, splash potions were simply `POTION`s with a higher data value.
|
||||
Note that the Material enum changes when there are new items or sometimes if items are reworked. As an example, the `SPLASH_POTION` enum value is not available in versions prior to Minecraft 1.9. Before then, splash potions were simply `POTION`s with a higher data value. In MobArena, however, `SPLASH_POTION` is the way to get splash potions in all supported server versions.
|
||||
|
||||
**Make sure to read [the important note on item IDs](./Item-Syntax#an-important-note-on-using-item-ids)!**
|
||||
|
||||
Examples: `diamond_sword`, `stone`, `42` (iron block), `322` (snowball)
|
||||
Examples: `diamond_sword`, `stone`, `leather_chestplate`
|
||||
|
||||
### 2. Multiple Items
|
||||
|
||||
[<id>|<name>]:<amount>
|
||||
<id>:<amount>
|
||||
|
||||
This way, you append an `<amount>` to the item, specifying how many of the given item you want. This is useful for giving out stuff like arrows or potions that you generally want to give more than one of.
|
||||
|
||||
Note that if you use this syntax, it is indeed the _amount_ you specify, not the item sub-type. We go over sub-types in the [next section](./Item-Syntax#3-item-sub-types-potions-wool-dyes-etc).
|
||||
|
||||
**Make sure to read [the important note on item IDs](./Item-Syntax#an-important-note-on-using-item-ids)!**
|
||||
|
||||
Examples: `arrow:64`, `grilled_pork:4`, `46:10` (10x TNT), `142:5` (5x potato)
|
||||
Examples: `arrow:64`, `grilled_pork:4`
|
||||
|
||||
### 3. Item Sub-Types (potions, wool, dyes etc.)
|
||||
|
||||
[<id>|<name>]:<data>:<amount>
|
||||
<id>:<data>:<amount>
|
||||
|
||||
This way, you append **BOTH** a `<data>` value (the sub-type) and an `<amount>`, regardless of how many of the given item you want. This syntax is mostly used with potions, which have special sub-type values in the 8000's and 16000's. Check out [this page](http://www.minecraftwiki.net/wiki/Potions#Primary_potions) for the potion sub-types.
|
||||
This way, you append **BOTH** a `<data>` value (the sub-type) and an `<amount>`, regardless of how many of the given item you want. This syntax is used for potions, dyes, and wool.
|
||||
|
||||
For wool and dyes (ink sacks), you don't have to use the numeric data value. Instead, you can use the _color names_ as defined in the [DyeColor _enum_ of the Bukkit API](http://jd.bukkit.org/rb/apidocs/src-html/org/bukkit/DyeColor.html#line.10).
|
||||
For potions, the sub-types are potion types as defined in the [PotionType enum of the Bukkit API](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionType.html). MobArena does not support upgraded and extended potions at this time.
|
||||
|
||||
**Make sure to read [the important note on item IDs](./Item-Syntax#an-important-note-on-using-item-ids)!**
|
||||
For wool and dyes (ink sacks), the sub-types are colors as defined in the [DyeColor enum of the Bukkit API](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/DyeColor.html).
|
||||
|
||||
Examples: `wool:blue:1` (one blue wool), `ink_sack:brown:10` (ten cocoa beans), `potion:8201:1` (one strength potion), `373:8197:2` (two health potions)
|
||||
|
||||
### An important note on using item IDs
|
||||
|
||||
If you choose to use item IDs, there is a catch. If an item is _alone_ in its node, it **MUST** be enclosed in apostrophes, or YAML will crap itself. For example, if you decide to have a Barbarian class that only has a pair of _lederhosen_ as armor, and nothing put a couple of health potions, you need to do it like this:
|
||||
|
||||
classes:
|
||||
Barbarian:
|
||||
items: '373:8197:2'
|
||||
armor: '300'
|
||||
|
||||
In other words, you have to put `'300'` in the `armor`-node, _not just_ `300`, and you have to put `'373:8197:2'` in the `items`-node, _not just_ `373:8197:2`. This requirement is removed if you use the item names instead, or if you add [enchantments](./Item-Syntax#enchantments) to the given item.
|
||||
Examples: `wool:blue:1` (one blue wool), `ink_sack:brown:10` (ten cocoa beans), `potion:strength:1` (one strength potion), `splash_potion:instant_heal:2` (two splash potions of health)
|
||||
|
||||
### Enchantments
|
||||
|
||||
Enchantments can be added to items by appending a space, followed by a _semi-colon separated list_ of pairs `<eid>:<level>`, where `<eid>` is an enchantment ID as defined by the ["ID (JE)" column](https://minecraft.gamepedia.com/Enchanting/ID) on the Minecraft Gamepedia, i.e.:
|
||||
Enchantments can be added to items by appending a space, followed by a _semi-colon separated list_ of pairs `<eid>:<level>`, where `<eid>` is an enchantment ID as defined by the [Enchantment enum of the Bukkit API](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html):
|
||||
|
||||
<item> <eid>:<level>;<eid>:<level>;...
|
||||
|
||||
The `<item>` is any item following the normal item syntax as described above. Here is an example:
|
||||
|
||||
diamond_sword 16:2;19:5
|
||||
diamond_sword sharpness:2;knockback:5
|
||||
|
||||
This line gives a diamond sword with sharpness (ID 16) level 2, and knockback (ID 19) level 5.
|
||||
This line gives a diamond sword with sharpness level 2, and knockback level 5.
|
||||
|
||||
### Economy Money
|
||||
|
||||
@ -85,7 +68,7 @@ This line gives a diamond sword with sharpness (ID 16) level 2, and knockback (I
|
||||
|
||||
MobArena supports entry fees and rewards in the form of money from economy plugins. This feature _requires Vault_. The format quite simply means that you type in a dollar sign followed by a valid monetary value.
|
||||
|
||||
Examples: `$1`, `$5`, `$3.14` (v0.96+), `$0.99` (v0.96+)
|
||||
Examples: `$1`, `$5`, `$3.14`, `$0.99`
|
||||
|
||||
### Command Rewards
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user