Skip to content

Alchemy

Urs P. Stettler edited this page Oct 24, 2013 · 5 revisions

Alchemy Module for ExpCraft

Combining CustomCrafting and ExpCraft level gathering.

Description

This module lets the players gain experience when crafting objects. It also allows to state new crafting recipes with specific level and exp values. It is possible to replace an existing minecraft recipe an add a level restriction.

Permissions

This module only has one permission node describing whether the module is active for players: ec.module.a

Settings

The configuration let the server admin declare new recipes and the amount of exp gained for standard minecraft recipes. Just start the server once with the module enabled and it will create a default config containing many examples now to create recipes.

Default Configuration

The config of this module is separated into two files. The module config:

# File: Alchemy.properties
# Exp gained when crafting standard minecraft recipes
ExpGain.Default=1.0
#
# path relative to this config file containg the custom recipes
Recipe.Definition=recipe.xml

...and the custom recipes:

<!-- File: recipe.xml -->
<!-- (Only a selection to illustrate recipe definitions) -->
<recipe>
  <furnace>
    <!-- smelt buckets into iron ingots -->
    <output item="IRON_INGOT" amount="3" />
    <input item="BUCKET" />
  </furnace>
  <shapeless>
    <!-- turn cobblestone into sand -->
    <output item="SAND" amount="2" />
    <inputs>
      <item item="COBBLESTONE" />
      <item item="COBBLESTONE" />
    </inputs>
  </shapeless>
  <shaped height="2" width="3" exp="5" level="10">
    <!-- crafting chainmail armor -->
    <output item="CHAINMAIL_HELMET" />
    <inputs>
      <item item="STONE" />
      <item item="STONE" />
      <item item="STONE" />
      <item item="STONE" />
      <item item="AIR" />
      <item item="STONE" />
    </inputs>
  </shaped>
</recipe>

You can use the item names as stated in org.bukkit.Material, or, the item's number as seen on the wiki. The data value or durability is used to define the color of wool or dye, the type of wooden planks and logs, etc.

Apropos wool. When defining the output (outcome or result) of a recipe you want to define the data value. While you can set it to -1 in the input section to allow all blocks of that type.

E.g., the recipe for the bed would look like this (5 := wooden planks, 35 := wool):

  <shaped height="2" width="3">
    <!-- a bed -->
    <output item="BED" amount="1" />
    <inputs>
      <item item="35" data="-1" />
      <item item="35" data="-1" />
      <item item="35" data="-1" />
      <item item="5" data="-1" />
      <item item="5" data="-1" />
      <item item="5" data="-1" />
    </inputs>
  </shaped>

Note that <item item="35" data="-1" /> means "any wool". If you have an empty space in your recipe, state an <item item="AIR" /> block at that location.

Shaped recipes must define the width and height of the recipe on the crafting bench. The <inputs /> appear from top-left to bottom-right, or, if you look at your numpad and you're defining a 3x3 recipe: The first item is placed on the 7, the second on the 8, third on 9, fourth on 4, etc.

E.g., the recipe for a torch looks like

  <shaped height="2" width="1">
    <!-- a bed -->
    <output item="TORCH" amount="4" />
    <inputs>
      <item item="COAL" data="-1" /><!-- include coal or charcoal ! -->
      <item item="STICK" />
    </inputs>
    <!-- COAL on 7 -->
    <!-- STICK on 4 -->
    <!-- since the recipe is only one block wide! -->
  </shaped>

ATM, furnace recipes do not "produce" exp or check the player's level. But you won't get an error, if you state them in the furnace recipe.

Clone this wiki locally