Skip to content

Crafting

Makes things from what the Inventory holds. Press Key (C) to open the list of Recipes and click one to make it; the ones there’s enough for are lit up.

Part of the Block Worlds module: Block worlds, Terraria style: worlds made from a seed (WorldGenerator), blocks that break, fall, glow and are kept in the save data (Blocks), digging and building (BlockBuilder), a Hotbar and Crafting, and the Sandbox template.

A recipe is what it makes (and how many), “=”, then what it takes joined with “+”: “Torch 4 = Wood + Coal”. Add “@ Workbench” to need a workbench nearby: a placed block of that item, or an entity of that name.

Requires: Inventory (what it makes things from)

Takes the player’s input only while the BlockBuilder it goes with has focus.

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • recipes: lines of text: an array of strings, or one string with line breaks = []. One recipe per row, e.g. “Planks 4 = Wood” or “Furnace = Stone 8 @ Workbench”. (One recipe per row: what it makes (and how many), “=”, what it takes joined with “+”, and “@” a workbench it needs nearby, e.g. “Planks 4 = Wood” or “Furnace = Stone 8 @ Workbench”. The Inspector lists them a row each, the items picked from what the game gives.) (Field: its own editor: Recipes.)
  • key: one of None, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, Space, Enter, Escape, Tab, Backspace, Left, Right, Up, Down, LeftShift, RightShift, LeftControl, RightControl, LeftAlt, RightAlt, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Delete, Insert, Home, End, PageUp, PageDown, CapsLock, NumPad0, NumPad1, NumPad2, NumPad3, NumPad4, NumPad5, NumPad6, NumPad7, NumPad8, NumPad9, NumPadPlus, NumPadMinus, NumPadMultiply, NumPadDivide, NumPadDecimal, Minus, Equals, Comma, Period, Slash, Backslash, Semicolon, Quote, LeftBracket, RightBracket, Grave = “C”. The key that opens and closes the list. (Field: one of its values.)
  • stationReach: a number = 4. How close a recipe’s workbench has to be, in world units. (A distance: the Scene view draws it as a circle around the entity, with a handle to drag.) (Field: a number.)
  • isOpen: true or false = false. True while the list is open. (Field: on or off.)
  • sound: text = null. A sound played when something is made. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)

Scripts use it as Crafting: its methods, events and values that aren’t saved with the scene.