main/Configuration 3.0/Definitions
In version 3.0, this has become too important to be left inside the main configuration file. Initially meant for defining custom materials, I've come to the realization that if the plugin logic wouldn't care what exactly is manipulating, making little to no difference between an ore material or an entire structure, the end result could become much more interesting.
The file is named "definitions.yml" and will be created as soon as the plugin gets activated, in the same location as the main configuration file, inside the <bukkit_folder>/plugins/CaveOreVeins folder. Together with all the common game materials, all the materials and items defined here can then be referenced by name throughout the root and child config files.
The format Bukkit is using to store configuration settings, for itself and for the plugins, is prone to user errors. When making changes to the configuration file, watch out for problems arising from bad formatting, mostly invalid indentation, which will render the entire config invalid. Never use TAB characters for indentation! Before activating your new configuration, always perform a check with the online YAML parser.
Standard Game Materials
You can use these throughout the plugin configs without defining them in here. A list of all the available materials can be found here. Not all the types of materials will work though.
Custom Game Materials
Assuming you'd like to use a standard game material, but you'd like to tweak the orientation, type of wood, wool colour, etc. This kind of information is usually stored as metadata, and the values are described in detail here.
An alternative is the material picker command, which allows you to pick the data value straight from your inventory or from any block already placed in the world.
TORCH_SOUTH: # you can reference game materials by type, # a full list can be found here: http://jd.bukkit.org/apidocs/org/bukkit/Material.html referencedMaterialName: TORCH typeData: 3 TORCH_NORTH: referencedMaterialName: TORCH typeData: 4
Custom Materials Injected by Other Plugins/Mods
Some materials are injected into the game. For these you're going to need the block id and the data value. Now true you can waste time browsing the forums and the wikis in an attempt to get them, but a much faster method would be to activate the material picker command, which will give you this information.
Here are a couple of examples from an MC/Bukkit server with Forge using the Forestry plugin:
APATITE_ORE: typeId: 4094 # Normally you wouldn't need to include a data value of 0, # but in this case is mandatory due to the fact the block id is shared with other materials typeData: 0 COPPER_ORE: typeId: 4094 typeData: 1 TIN_ORE: typeId: 4094 typeData: 2
As you can see I've assigned some names to these materials, which allows me to easily reference them anywhere inside the configuration files, especially in the ore spawner section. They have nothing to do with their actual name assigned by the plugin or Forge, which in case of these materials is something like X9045, X9046, etc.
Entity Spawners
Some items cannot be created as normal blocks through their block id and data. They require special treatment by the plugin, and entity spawners are a good example. Here is how you define them:
SPAWNER_ZOMBIE: referencedMaterialName: MOB_SPAWNER #not required for 3.2.0 and later spawnsEntity: ZOMBIE
For version 3.2.0 and later, you can use the entity types defined here.
For older versions, you can find a list of what can be spawned in this way by having a look here. Use the name rather than the type. For example, primed TNT is listed there as PRIMED_TNT("PrimedTnt", ...). Use the text written inside the quotes and not the type.
SPAWNER_TNT: referencedMaterialName: MOB_SPAWNER spawnsEntity: PrimedTNT
Entity Eggs (introduced in 3.2.0)
Eggs can spawn entities on demand, when getting thrown by the player.
EGG_VILLAGER: # referencedMaterialName is inferred when hatchesEntity is used hatchesEntity: VILLAGER
The list of game entities can be found here. Not all of them will work, so make sure you check the wiki first.
Chest Potions (introduced in 3.2.0)
Potions can be included in chests, but before you reference them in there, you need to describe them first.
POTION_NIGHT_VISION: # referencedMaterialName is inferred when potionType is used potionType: NIGHT_VISION POTION_POISON: potionType: POISON # a bunch of other optional parameters are available # if true, the potion can be used on other living entities potionSplash: true # potionLevel indicates the strength of the potion # (see here the list of available levels: http://www.minecraftwiki.net/wiki/Potions) potionLevel: 2 # extended effect of the potion potionExtendedTime: true POTION_RANDOM: potionType: random
The type of the potion can be either "random" or one listed here. Ensure a level is functionally supported by the game, for a particular potion type, by checking the wiki.
Enchanted Chest Items (introduced in 3.2.0)
The items you include in the chests can be enchanted.
IRON_PICKAXE_EXTRA_EFFICIENT: referencedMaterialName: IRON_PICKAXE enchantType: DIG_SPEED # min and max levels (a random value will be picked) # maximum values can be found here: http://www.minecraftwiki.net/wiki/Enchanting enchantMinLevel: 1 enchantMaxLevel: 3 BOW_EXTRA_POWERFUL: referencedMaterialName: BOW enchantType: ARROW_DAMAGE # fixed level enchantLevel: 2
A list of enchantment types can be found here.
Following the general rule, you can either reference in-game materials or materials previously defined in this file.
Make sure you check the wiki first to ensure that a particular combination of material, enchantment type and level is functionally supported by the game.
Chests
Chests contain an inventory, which you can define by listing individual items having a fixed amount or a random one (between a minimum and a maximum), and a probability of appearing in the chest. When you define a chest, it can inherit the contents of another one.
REWARD_BASIC_CHEST: # chests must always reference the game material 'CHEST' or other chests referencedMaterialName: CHEST # not required for 3.2.0 or later inventory: # either use standard game materials (http://jd.bukkit.org/apidocs/org/bukkit/Material.html) or a material you've defined earlier. IRON_PICKAXE: # the actual amount is a random value between the minimum and maximum minAmount: 1 maxAmount: 3 probabilityPercentage: 100 BREAD: # fixed amount amount: 3 probabilityPercentage: 70 STRING: # no probability means 100% (the item will always appear in the chest) amount: 3 FEATHER: minAmount: 3 maxAmount: 6 BOW: minAmount: 1 maxAmount: 2 probabilityPercentage: 40 ARROW: amount: 3 # the probability is computed only once for each chest instance, # so in our case when the bow is spawned, we can be sure the arrows get spawned as well probabilityPercentage: 45
Structures
The way structures get spawned has changed in version 3.0. If before they randomly appeared based on a combination of settings and the fact the plugin couldn't reach a desired ore distribution, they are now treated as "impurities" in the ore vein, same as any other single block material. They not only add a sense of underground adventure, but they also help in linking more veins. They can reference any other game materials, or custom ones defined in this file, or even other structures, as you can see in the following samples:
ORE_CAVE_HUB: # structures cannot have reference materials through 'referencedMaterialName' # instead, place materials and other structures in the layout section layout: # since 3.0, these structures shouldn't have a stone shell, # as they will be injected straight into the path of the veins # coordinates are specified in [x, y, z] (y being the height in Minecraft), all relative to an imaginary center at [0, 0, 0] # keep the entire structure centered for best results MOSSY_COBBLESTONE: # 'from', 'to' and 'at' are relative to the center of the cave - from [-3, -1, -3] to [ 3, -1, 3] AIR: - from [-3, 0, -3] to [ 3, 3, 3] STONE: # materials cannot appear more than once in this section so they must be grouped # here we provide a set of pillars for the torches to rest on - from [0, -1, -4] to [0, 2, -4] - from [0, -1, 4] to [0, 2, 4] TORCH_SOUTH: # south is going towards positive Z, so we stick them on the opposite wall - at [ 0, 2, -3] TORCH_NORTH: # north is going towards negative Z, so we stick them on the opposite wall - at [ 0, 2, 3] ORE_CAVE_HUB_LIGHT: layout: # you can reference another structure, thereby copying its content ORE_CAVE_HUB: - at [0, 0, 0] REWARD_MINING_CHEST: - at [0, 0, 0] SPAWNER_ZOMBIE: - at [-2, 0, 0] ORE_CAVE_HUB_CHALLENGING: layout: ORE_CAVE_HUB_LIGHT: - at [0, 0, 0] # you can overwrite the contents of a referenced cave, if the relative positions overlap REWARD_GEMS_CHEST: - at [0, 0, 0] SPAWNER_SKELETON: - at [2, 0, 0] ORE_CAVE_HUB_VERY_DANGEROUS: layout: MOSSY_COBBLESTONE: - from [-1, -1, -4] to [ 1, -1, 4] AIR: - from [-1, 0, -4] to [ 1, 3, 4] SPAWNER_LAVA_SLIME: - at [0, 0, 0] REWARD_WARRIOR_CHEST: - at [0, 0, 1]
The entire "definitions.yml" file described on this page can be found here.