Skip to content

Instantly share code, notes, and snippets.

@Pablissimo
Created July 29, 2019 09:40
Show Gist options
  • Save Pablissimo/842d0d498a2a6a7f1d413a25c3184a74 to your computer and use it in GitHub Desktop.
Save Pablissimo/842d0d498a2a6a7f1d413a25c3184a74 to your computer and use it in GitHub Desktop.
An extract of the items in Minecraft and recipes to craft them, and the script to do the extract (to be run in Chrome Developer Tools) from http://minecraftsavant.weebly.com
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Item
Wooden Plank
Stick
Torch
Crafting Table
Furnace
Chest
Wood Pickaxe
Stone Pickaxe
Iron Pickaxe
Gold Pickaxe
Diamond Pickaxe
Wood Shovel
Stone Shovel
Iron Shovel
Gold Shovel
Diamond Shovel
Wood Axe
Stone Axe
Iron Axe
Gold Axe
Diamond Axe
Wood Hoe
Stone Hoe
Iron Hoe
Gold Hoe
Diamond Hoe
Bucket
Flint and Steel
Fire Charge
Fishing Rod
Carrot on a Stick
Compass
Clock
Map
Shear
Wood Sword
Stone Sword
Iron Sword
Gold Sword
Diamond Sword
Bow
Arrow
Leather Helmet
Iron Helmet
Gold Helmet
Diamond Helmet
Leather Chestplate
Iron Chestplate
Gold Chestplate
Diamond Chestplate
Leather Legging
Iron Legging
Gold Legging
Diamond Legging
Leather Boot
Iron Boot
Gold Boot
Diamond Boot
Iron Block
Gold Block
Diamond Block
Emerald Block
Lapis Lazuli block
Glowstone
Clay Block
Brick
Stone Brick
Sandstone
Smooth Sandstone
Decorative Sandstone
Snow Block
Wool Block
Wooden Slab
Stone Slab
Sandstone Slab
Stone Brick Slab
Brick Slab
Cobblestone Slab
Wood Stair
Cobblestone Stair
Wood Door
Iron Door
Trapdoor
Ladder
Fence
Fence Gate
Nether Brick Fence
Cobblestone Wall
Mossy Cobblestone Wall
Iron Bar
Glass Pane
Bread
Mushroom Stew
Cake
Cookie
Pumpkin Pie
Golden Carrot
Golden Apple
Enchanted Golden Apple
Melon
Paper
Book
Book and Quill
Sign
Painting
Item Frame
Flower Pot
Bowl
Sugar
Pumpkin Seed
Melon Seed
Glistening Melon
Gold Ingot
Bed
Beacon
Cauldron
Enchantment Table
Ender Chest
Anvil
Blaze Powder
Brewing Stand
Eye of Ender
Fermented Spider Eye
Bottle
Magma Cream
Wood
Coal
Cobblestone
Stone Block
Iron Ingot
Diamond
Flint
Gunpowder
String
Carrot
Redstone Dust
Feather
Leather
Emerald
Lapis Lazuli
Glowstone Dust
Clay Ball
Clay Brick
Sand
Snowball
Stone
Nether Brick
Mossy Cobblestone
Glass
Wheat
Red Mushroom
Brown Mushroom
Milk
Egg
Cocoa Bean
Pumpkin
Gold Nugget
Apple
Melon Slice
Sugar Cane
Ink Sac
Wool
Nether Star
Obsidian
Eye Of Ender
Blaze Rod
Ender Pearl
Spider Eye
Slime Ball
Cooked Chicken
Cooked Porkchop
Steak
Cooked Fish
Baked Potato
Charcoal
Iron Ingot
Gold Ingot
Glass
Stone
Brick
Nether Brick
Cactus Green
Raw Chicken
Fuel
Raw Porkchop
Raw Beef
Raw Fish
Potato
Wood
Iron Ore
Gold Ore
Sand
Cobblestone
Clay
Netherrack
Cactu
OutputItem Qty InputItem
Wooden Plank 1 Wood
Stick 2 Wooden Plank
Torch 1 Stick
Torch 1 Coal
Crafting Table 4 Wooden Plank
Furnace 8 Cobblestone
Chest 8 Wooden Plank
Wood Pickaxe 2 Stick
Wood Pickaxe 3 Wooden Plank
Stone Pickaxe 2 Stick
Stone Pickaxe 3 Stone Block
Iron Pickaxe 2 Stick
Iron Pickaxe 3 Iron Ingot
Gold Pickaxe 2 Stick
Gold Pickaxe 3 Gold Ingot
Diamond Pickaxe 2 Stick
Diamond Pickaxe 3 Diamond
Wood Shovel 2 Stick
Wood Shovel 1 Wooden Plank
Stone Shovel 2 Stick
Stone Shovel 1 Stone Block
Iron Shovel 2 Stick
Iron Shovel 1 Iron Ingot
Gold Shovel 2 Stick
Gold Shovel 1 Gold Ingot
Diamond Shovel 2 Stick
Diamond Shovel 1 Diamond
Wood Axe 2 Stick
Wood Axe 3 Wooden Plank
Stone Axe 2 Stick
Stone Axe 3 Stone Block
Iron Axe 2 Stick
Iron Axe 3 Iron Ingot
Gold Axe 2 Stick
Gold Axe 3 Gold Ingot
Diamond Axe 2 Stick
Diamond Axe 3 Diamond
Wood Hoe 2 Stick
Wood Hoe 2 Wooden Plank
Stone Hoe 2 Stick
Stone Hoe 2 Stone Block
Iron Hoe 2 Stick
Iron Hoe 2 Iron Ingot
Gold Hoe 2 Stick
Gold Hoe 2 Gold Ingot
Diamond Hoe 2 Stick
Diamond Hoe 2 Diamond
Bucket 3 Iron Ingot
Flint and Steel 1 Iron Ingot
Flint and Steel 1 Flint
Fire Charge 1 Blaze Powder
Fire Charge 1 Coal
Fire Charge 1 Gunpowder
Fishing Rod 3 Stick
Fishing Rod 2 String
Carrot on a Stick 1 Fishing Rod
Carrot on a Stick 1 Carrot
Compass 4 Iron Ingot
Compass 1 Redstone Dust
Clock 4 Gold Ingot
Clock 1 Redstone Dust
Map 8 Paper
Map 1 Compass
Shear 2 Iron Ingot
Wood Sword 1 Stick
Wood Sword 2 Wooden Plank
Stone Sword 1 Stick
Stone Sword 2 Stone Block
Iron Sword 1 Stick
Iron Sword 2 Iron Ingot
Gold Sword 1 Stick
Gold Sword 2 Gold Ingot
Diamond Sword 1 Stick
Diamond Sword 2 Diamond
Bow 3 Stick
Bow 3 String
Arrow 1 Flint
Arrow 1 Stick
Arrow 1 Feather
Leather Helmet 5 Leather
Iron Helmet 5 Iron Ingot
Gold Helmet 5 Gold Ingot
Diamond Helmet 5 Diamond
Leather Chestplate 8 Leather
Iron Chestplate 8 Iron Ingot
Gold Chestplate 8 Gold Ingot
Diamond Chestplate 8 Diamond
Leather Legging 7 Leather
Iron Legging 7 Iron Ingot
Gold Legging 7 Gold Ingot
Diamond Legging 7 Diamond
Leather Boot 4 Leather
Iron Boot 4 Iron Ingot
Gold Boot 4 Gold Ingot
Diamond Boot 4 Diamond
Iron Block 9 Iron Ingot
Gold Block 9 Gold Ingot
Diamond Block 9 Diamond
Emerald Block 9 Emerald
Lapis Lazuli block 9 Lapis Lazuli
Glowstone 4 Glowstone Dust
Clay Block 4 Clay Ball
Brick 4 Clay Brick
Stone Brick 4 Stone Block
Sandstone 4 Sand
Smooth Sandstone 4 Sandstone
Decorative Sandstone 2 Sandstone Slab
Snow Block 4 Snowball
Wool Block 4 String
Wooden Slab 6 Wooden Plank
Stone Slab 3 Stone
Sandstone Slab 3 Sandstone
Stone Brick Slab 3 Stone Brick
Brick Slab 3 Brick
Cobblestone Slab 3 Cobblestone
Wood Stair 6 Wooden Plank
Cobblestone Stair 6 Cobblestone
Wood Door 6 Wooden Plank
Iron Door 6 Iron Ingot
Trapdoor 6 Wooden Plank
Ladder 7 Stick
Fence 6 Stick
Fence Gate 4 Stick
Fence Gate 2 Wooden Slab
Nether Brick Fence 6 Nether Brick
Cobblestone Wall 6 Cobblestone
Mossy Cobblestone Wall 6 Mossy Cobblestone
Iron Bar 6 Iron Ingot
Glass Pane 6 Glass
Bread 3 Wheat
Mushroom Stew 1 Red Mushroom
Mushroom Stew 1 Brown Mushroom
Mushroom Stew 1 Bowl
Cake 3 Milk
Cake 2 Sugar
Cake 1 Egg
Cake 3 Wheat
Cookie 2 Wheat
Cookie 1 Cocoa Bean
Pumpkin Pie 1 Pumpkin
Pumpkin Pie 1 Sugar
Pumpkin Pie 1 Egg
Golden Carrot 8 Gold Nugget
Golden Carrot 1 Carrot
Golden Apple 8 Gold Nugget
Golden Apple 1 Apple
Enchanted Golden Apple 8 Gold Block
Enchanted Golden Apple 1 Apple
Melon 9 Melon Slice
Paper 3 Sugar Cane
Book 3 Paper
Book 1 Leather
Book and Quill 1 Book
Book and Quill 1 Feather
Book and Quill 1 Ink Sac
Sign 6 Wooden Plank
Sign 1 Stick
Painting 8 Stick
Painting 1 Wool
Item Frame 8 Stick
Item Frame 1 Leather
Flower Pot 3 Brick
Bowl 3 Wooden Plank
Sugar 1 Sugar Cane
Pumpkin Seed 1 Pumpkin
Melon Seed 1 Melon Slice
Glistening Melon 1 Melon Slice
Glistening Melon 1 Gold Nugget
Gold Ingot 9 Gold Nugget
Bed 3 Wool
Bed 3 Wooden Plank
Beacon 5 Glass
Beacon 1 Nether Star
Beacon 3 Obsidian
Cauldron 7 Iron Ingot
Enchantment Table 1 Book
Enchantment Table 2 Diamond
Enchantment Table 4 Obsidian
Ender Chest 8 Obsidian
Ender Chest 1 Eye Of Ender
Anvil 3 Iron Block
Anvil 4 Iron Ingot
Blaze Powder 1 Blaze Rod
Brewing Stand 1 Blaze Rod
Brewing Stand 3 Cobblestone
Eye of Ender 1 Blaze Powder
Eye of Ender 1 Ender Pearl
Fermented Spider Eye 1 Spider Eye
Fermented Spider Eye 1 Brown Mushroom
Fermented Spider Eye 1 Sugar
Bottle 3 Glass
Magma Cream 1 Slime Ball
Magma Cream 1 Blaze Powder
Cooked Chicken 1 Raw Chicken
Cooked Chicken 1 Fuel
Cooked Porkchop 1 Raw Porkchop
Cooked Porkchop 1 Fuel
Steak 1 Raw Beef
Steak 1 Fuel
Cooked Fish 1 Raw Fish
Cooked Fish 1 Fuel
Baked Potato 1 Potato
Baked Potato 1 Fuel
Charcoal 1 Wood
Charcoal 1 Fuel
Iron Ingot 1 Iron Ore
Iron Ingot 1 Fuel
Gold Ingot 1 Gold Ore
Gold Ingot 1 Fuel
Glass 1 Sand
Glass 1 Fuel
Stone 1 Cobblestone
Stone 1 Fuel
Brick 1 Clay
Brick 1 Fuel
Nether Brick 1 Netherrack
Nether Brick 1 Fuel
Cactus Green 1 Cactu
Cactus Green 1 Fuel
var tables = Array.from(document.getElementsByClassName("wsite-multicol-table"));
var recipes = tables.map(t =>
{
var toReturn = {};
var item = t.rows[0].cells[0].innerText.trim();
var ingredients = t.rows[0].cells[1].innerText.split("\n");
toReturn.item = item;
toReturn.ingredientsUnparsed = ingredients.filter(i => i.length > 0).map(i => i.trim());
return toReturn;
});
// Fix up the casing of each ingredient, and parse the ingredient lists so
// that we have numeric quantities and lists of {name, qty} pairs instead of
// just an array of strings
recipes.forEach(r => {
// Look for an optional leading string of digits, an ingredient name
// and an optional trailing 'and' literal (which we'll discard)
var extractionRegex = /^([0-9]+)? ?(.+?)( and)?$/;
// Shamelessly nicked from StackOverflow
// https://stackoverflow.com/a/4068586/677173
var fixCasing = s => s.replace(/(\w)(\w*)/g, (g0, g1, g2) => g1.toUpperCase() + g2.toLowerCase());
var parsed = [];
for (var i = 0; i < r.ingredientsUnparsed.length; i++) {
var match = extractionRegex.exec(r.ingredientsUnparsed[i]);
if (match) {
parsed.push({ qty: (match[1] || 1), item: fixCasing(match[2]) });
}
}
r.ingredients = parsed;
});
var depluralise = str => {
if (!str.endsWith("s") || str == "Compass" || str == "Glass") {
return str;
}
if (str == "Torches") {
return "Torch";
}
else {
return str.substring(0, str.length - 1);
}
};
recipes.forEach(r => r.item = depluralise(r.item));
recipes.forEach(r => r.ingredients.forEach(i => i.item = depluralise(i.item)));
// Are there any issues? This set should only contain things that are
// 'raw materials' (or forgeable)
new Set(recipes.flatMap(r => r.ingredients.map(i => i.item))
.filter(i => recipes.map(r => r.item).indexOf(i) < 0));
// Fix up specific data issues
recipes
.forEach(r => r.ingredients.filter(i => i.item == "Wood Plank")
.forEach(i => i.item = "Wooden Plank"));
recipes
.forEach(r => r.ingredients.filter(i => i.item == "Two Wooden Slab")
.forEach(i => { i.item = "Wooden Slab"; i.qty = 2; }));
// Produce two CSVs (in string form):
// Item list
var itemList = Array.from(new Set(recipes.map(r => r.item).concat(recipes.flatMap(r => r.ingredients.map(i => i.item))))).join("\n");
// Recipes list - item and ingredient connections
var recipesList = recipes.flatMap(r => r.ingredients.map(i => `${r.item},${i.qty},${i.item}`)).join("\n");
console.log("---- START ITEMS CSV (do not include this line) ---");
console.log("Item\n" + itemList);
console.log("---- END ITEMS CSV (do not include this line) ---");
console.log("\n\n");
console.log("---- START RECIPES CSV (do not include this line) ---");
console.log("OutputItem,Qty,InputItem\n" + recipesList);
console.log("---- END RECIPES CSV (do not include this line) ---");
console.log("Done! You need to run this on both pages, and concatenate the outputs. Exclude the headers on the second page's files when concatenating.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment