Wiki

Clone wiki

Alfheim / AlfTweaking or how to use MT3 to change recipies

Alfheim adds some new crafting mechanics like elven infusion or reverse trade portal, also an Anyavil and spells. This page describes everything what you can do with those using minetweaker scripts.

NBT support: default recipes will check every nbt key from input stack (in game) to match with ingredient stack (in script). But that can be changed by adding special flag tags to ingredients:

  • Use ASJIGNORENBT byte tag with value 1 to completely ignore NBT.

  • Use ASJONLYNBT byte tag with value 1 to check equality only for NBT tags from ingredient, ignoring those not presented in it.

(see official MT wiki if you need info on adding NBT to script recipes)

Every handler class is located in mods.alfheim package.

Table of Contents:


Mana Infuser

ManaInfuser class

Add recipe

To add any recipe you should use addRecipe function passing output stack, amount of mana and a list of ingredients.

Example: ManaInfuser.addRecipe(<minecraft:egg>, 5000, [<minecraft:iron_ingot> * 2, <ore:ingotGold>]) Will add recipe for egg from two iron ingots, one anything under ingotGold ore name and 5000 mana.

Remove recipe

To remove recipies you should use removeRecipe passing output stack. It will remove EVERY recipe with equal output.

Example: ManaInfuser.removeRecipe(<Botania:manaResource:4>) Will remove all recipes for terrasteel ingot.

Add lexicon page

To add new lexicon page to any entry you should use addRecipePage function passing entry unlocalized name, new page unlocalized name, page index, output stack and recipe index (if there is more than one infusion recipe for output stack - rare case).

Example: ManaInfuser.addRecipePage("elvorium", "alfheim.page.elvorium.new", 1, <Botania:manaResource:4>, 0) Will add terrasteel infuser recipe to entry about elvorium on the "index (1) + 1" - second page (moving original second page to third position)


Mana Tuner

ManaTuner class (since Alfheim-54)

Add recipe

To add any recipe you should use addRecipe function passing burst colors template string, output stack, core stack (dropped above tuner) and a list of ingredients.

Example: ManaTuner.addRecipe("apple", <minecraft:golden_apple>, <minecraft:apple>, [<minecraft:gold_ingot>, <minecraft:gold_ingot>]) Will add recipe for golden apple from two gold ingots placed inside tuner, one apple dropped atop, and with sequence of orange, purple, purple, pink, and magenta bursts.

Add lexicon page

To add new lexicon page to any entry you should use addRecipePage function passing entry unlocalized name, new page unlocalized name, page index, burst colors template string, output stack, core stack, and recipe index (if there is more than one tuning recipe for output stack - rare case).

Example: ManaTuner.addRecipePage("infiniteFruit", "botania.page.infiniteFruit.new", 2, "apple", <minecraft:golden_apple>, <minecraft:apple>, 0) Will add golden apple tuning recipe to entry about the Fruit of Grisaia on the last page.


Tree Suffuser

Suffuser class

Add recipe

To add any recipe you should use addRecipe function passing output stack with resulting block, middle block stack, amount of mana required, mana consumed per tick and a list of ingredients.

Example: Suffuser.addRecipe(<Botania:specialFlower>.withTag({subTileName: "manastar", id: "botania:specialFlower", SuffusedTile: 1 as byte}), <Botania:specialFlower>.withTag({subTileName: "daybloom", ASJONLYNBT: 1 as byte}), 500000, 5000, [<minecraft:diamond>, <minecraft:nether_star>]) Will add recipe for Manastar flower from Daybloom, 500000 mana (consuming 5000 per tick), one netherstar and a diamond.

NOTE: SuffusedTile byte tag indicates that output block must load NBT data from stack to its tile entity, indicated by id tag. ASJONLYNBT in middle block forces only subTileName tag check, ignoring any other tags (coords, mana, etc) as noted above.

Remove recipe

To remove recipies you should use removeRecipe passing output block stack. It will remove EVERY recipe with equal output.

Example: Suffuser.removeRecipe(<alfheim:sealingSapling>) Will remove all recipes for sealing oak sapling.

Add lexicon page

To add new lexicon page to any entry you should use addRecipePage function passing entry unlocalized name, new page unlocalized name, page index and output stack.

Example: Suffuser.addRecipePage("tctrees", "alfheim.page.tctrees.new", 7, <alfheim:Subspacian>) Will add subspacian recipe (if any) to entry about Thaumcraft plants suffusion on the "index (7) + 1" - 8th page


Midgard Trade Portal

TradePortal class

Remove reverse exchange

To exclude any item from appearing on trade portal "screen" use banRetrade with input stack. This CAN NOT be undone.

Example: TradePortal.banRetrade(<Botania:dreamwood>) Will remove dreamwood from input (you won't be able to get livingwood through trade portal).


Anyavil

Anyavil class

Set pink power points

To change how much pink energy some item contains, use pinkify function with specified stack and amount of pink power. Passing values L/E than 0 will remove energy.

Example: Anyavil.pinkify(<alfheim:ElvenItems:2>, 5) Will add 5ppp to elvorium uingot.


Spell parameters

Spells class.

Set mana cost

To change how much mana does spell consume on cast use setManaCost function with spell name and new amount of mana required. Note: since BETA-27 to find default cost you should either be affine to spell's element (be salamander for fireball, etc) or divide manacost by cost multiplier from configs (defaults to 2)

Example: Spells.setManaCost("fireball", 50000) Will set fireball to require 50000 MP

Set cooldown

To change how long is the period between two casts of same spell use setCooldown function with spell name and new time.

Example: Spells.setCooldown("fireball", 100) Will set delay between two fireball casts to 100 ticks

Set cast time

To change how much time does it take to cast a spell use setCastTime function with spell name and new time.

Example: Spells.setCastTime("fireball", 50) Will set fireball casting time to 50 ticks

Change Top-level magic status

To make any spell a top-level magic (with same manacost for all races) or remove such status you should use setSpecial function with spell name and "is top-level?" value.

Example: Spells.setSpecial("fireball", true) Will make fireball a top-level magic

Set precise parameters

To precisely change spell parameters such as damage, range, etc, use setParams function with spell name and 4 parameters called damage, duration, efficiency, radius. Not each parameter is used in every spell, so if you don't need one of them - just leave zero value for that parameter. List of parameters available to change for a spell along with their current values can be viewed by using /mtspell command on selected spell.

Example: Spells.setParams("fireball", 20, 300, 1, 15) Will make fireball deal 20 damage, fly for 300 ticks with speed 1 block per tick and damage everyone in radius of 15 blocks.


Mob spawn

MobSpawn class

Add mob spawn

To add a new mob to spawn in a certain dimension and optionally certain biomes (with Alfheim-specific spawn algorythm, not the best for nether-type worlds) you should use addMob function passing mob registry name (as seen in /summon command), max mobs per player count, min and max group size, dimension ID and optional array of biomes (which can be both ID int[] array for regular biomes or names string[] array for WorldEngine-powered dimensions such as Alfheim) - if biomes are not specified will spawn in any biome in the dimension.

Example: MobSpawn.addMob("Creeper", 10, 2, 3, -105, ["Field", "High plateau field"] as string[]) Will add creepers to be able to spawn in Alfheim, in Field and High plateau field biomes, with limit of 10 creepers per player in world, spawning 2-3 creepers at a time.


Petronia fuel

Petronia class

Add fuel type

To add a new fuel for Petronia flower you should use registerFuel function passing fuel name, one bucket of volume (default 1000) burn time and mana gen per tick.

Example: Petronia.registerFuel("mana", 100, 50) Will add Liquid Mana as a valid fuel, burning for 100 ticks and producing 50 mana per tick.

Updated