Skip to content

Craft Tweaker

Mohron edited this page Dec 14, 2019 · 6 revisions

CraftTweaker

Anvil Recipes

Syntax

mods.rockytweaks.Anvil.addRecipe(left-input, right-input, output, exp-cost);

Example Usage

Single

import mods.rockytweaks.Anvil;

// Creates individual anvil recipes that a displayed separately in JEI
// Adds a recipe to the anvil requiring 1 Book, 8 Quartz and 5 levels to make a Sharpness I enchanted book
Anvil.addRecipe(<minecraft:book>, <minecraft:quartz> * 8, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}), 5);
// 1 Book + 16 Quartz + 16 levels = Sharpness II
Anvil.addRecipe(<minecraft:book>, <minecraft:quartz> * 16, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 2 as short, id: 16 as short}]}), 15);
// 1 Book + 32 Quartz + 36 levels = Sharpness III
Anvil.addRecipe(<minecraft:book>, <minecraft:quartz> * 32, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 3 as short, id: 16 as short}]}), 36);

Multiple

// Creates multiple anvil recipes that JEI cycles through the possible options
// Add the above recipes in a single recipe group
Anvil.addRecipes(<minecraft:book>,
  [
    <minecraft:quartz> * 8,
    <minecraft:quartz> * 16,
    <minecraft:quartz> * 32
  ],
  [
    <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}),
    <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 2 as short, id: 16 as short}]}),
    <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 3 as short, id: 16 as short}]})
  ],
  [
    5,
    15,
    32
  ]
);

https://gyazo.com/90b18908e54b05b9dbbe9ce347ed0270

https://gyazo.com/09f2fef0b99dea096e73debcdf997167

Merchant Trades

Syntax

mods.rockytweaks.Merchant.addTrade(profession, career, left-input, right-input, output, level);

Commands

  • /ct merchant professions - outputs a log of valid merchant professions
  • /ct merchant careers [profession] - outputs a log of valid careers for all or the specified profession

Example Usage

import mods.rockytweaks.Merchant;

Merchant.addTrade("minecraft:nitwit", "nitwit", <minecraft:emerald>, <minecraft:diamond>, <minecraft:cobblestone>, 1);
Merchant.addTrade("minecraft:priest", "cleric", <minecraft:diamond>, <minecraft:stone>, 1);

https://gyazo.com/515a81c7d25e8595aaa61194ac9522fd https://gyazo.com/cd560d7317cc78d649b2edaf49983ecc

Clone this wiki locally