main/Configuration/tutorial
Sections
These sections may require a more detailed explanation than a simple overview. The sections themselves are found at the top level of the configuration file:
mobs: # ect. items: # ect.
Mobs Section
This part allows you to specify how much experience players should be awarded when they kill mobs. If a mob isn't specified, the plugin will fall back on the default behavior (or give nothing, if default rewards are disabled).
Experience Amount
To set the experience awarded, you must construct a rule. These rules can be quite simple - to change the experience for all zombie kills, you simply state the name of the mob and the corresponding quantity of experience:
mobs: zombie: 10
You can also specify a range of experience points. The awarded experience will then be a random number within this range (inclusive).
mobs: zombie: [5, 10] skeleton: first: 5 last: 10
Both methods are equivalent. The range [5, 10] will award a random experience from the following set of numbers: {5, 6, 7, 8, 9, 10}.
You can also using decimal points, for both scalar values and ranges:
mobs: zombie: 0.1
Given the fact that experience points are whole integers, you cannot award this amount directly. Instead, a single experience point is given 10% of the time, and in the other 90% nothing. This works out to be roughly 0.1 experience per kill.
Rule Body
While altering each mob individually works, it can be a tad annoying if you're going to change every mob in the game. If that's the case, you can mark the name with a question mark:
mobs: ?: 5
You could also disable all experience drops, just like the root setting Default rewards disabled:
mobs: ?: 0
But things only get interesting if you combine this with the pipe (|) operator that functions like a filter. A useful example is matching every mob killed by magic (splash potions):
mobs: ?|magic: 0
This will prevent experience from dropping when a player kills a mob using potions. You can even add experience drops to mobs that haven't been killed by a player (only works in ExperienceMod 1.2.3)
mobs: ?|fall: 5
Rule Conflict
In addition to mob name and kill type, you can also match mobs that has spawned from a mob spawner:
mobs: zombie: 5 ?|?|spawner: 0
Note that when rules conflict - i.e. above a spawned zombie will match both rules - it is the last and most specified rule that takes precedent. Here both rules only specify one attribute each (name and spawner), so the conflict is resolved by position alone. This means the "spawner" rule will win out and a spawned zombie won't drop any experience. Had the "zombie" rule been written last, a spawned zombie would have dropped 5 experience, and any other spawned mob zero.
If this sounds complicated, just put the most important rules last.
Other than spawner, you can also match by baby (young, passive animal) or tamed (wolf).
mobs: pig|?|!baby: 5 pig|?|baby: 1 # piglet
You use an exclamation point to match the opposite (!baby = adult and !tamed = untamed). In the above example, we set the drop amount of both pigs and piglets.
Items Section
Items and blocks can, just like mobs, be matched by name. But you must also specify the action (mining, placing, brewing, smelting and crafting), and the corresponding amount of experience:
items: coal ore: block source: [3, 9] mob spawner: bonus source: [50, 100] iron ingot: smelting result: [3, 9]
Notice that you must specify the experience on the result of the smelting, here an iron ingot, whilst mined blocks must be specified on the block type, not the dropped material.
However, you can still use numeric block IDs if you prefer.
It's also possible to match multiple block names and data values at once:
items: glowing redstone ore, redstone ore: block source: 10 wool|red,green,blue: crafting result: 5
The different actions (or triggers) are as follows:
Trigger | Description |
---|---|
block source | Invoked when a block has been mined (without silk touch). |
bonus | Invoked when a block has been destroyed, regardless of silk touch. |
smelting result | Invoked when an item or items have been smelted. The given experience is granted for every produced item. |
crafting result | Invoked when an item has been crafted. |
brewing result | Invoked when a potion has been brewed. |
placing result | Invoked when a block has been placed. Note, this can easily be abused. |
In addition, you can match by durability (or data value):
items: coal|0: # Normal coal smelting result: 5 coal|1: # Charcoal smelting result: 0
In some cases you're even able to use name instead of the numeric data value:
items: wood|oak: crafting result: 5 wood|redwood: crafting result: 5 wood|birch: crafting result: 3 wood|jungle: crafting result: 2
And for wool:
items: wool: crafting result: 5 wool|brown: # Much harder to make crafting result: 20
Custom Blocks from Mods
If you're attempting to match non-standard blocks (such as custom blocks from mods, like the Technic Pack), you must use the block ID instead of the name:
reward type: virtual items: 46: placing result: -5 # cost
Note that, as of 2.1.0, new and custom item processing blocks such as furnaces or crafting tables will have no effect.
Potions
While you can match potions by their actual durability value, it's much easier and more versatile to match them by their individual attributes:
items: potion|?|1|!splash|!extended: brewing result: 20 potion|instant heal|1|!splash|!extended: brewing result: 50
This will give 20 experience for every secondary potion the player brews, with the exception of instant heal awarding 50 experience.
Finally, a list of every potion type can be found here.
Comments