Register

Beaver's Crafting Module

An Add-on Module for Foundry Virtual Tabletop

Author: AngryBeaver Project: Source Foundry Versions 10+ (Verified 14) Last Updated 47 minutes ago

Recipes for everything your characters can work on over time:

A recipe can

It works in possibly every system through the Beaver's System Interface (list of adaption layers).

New to the module? Start with the ready-made recipes: with dnd5e you get a recipe for every tool of the D&D 2024 rules out of the box.

Features

Crafting

Crafting

Create a recipe

Video: create a recipe (MP4)

Craft it

Video: craft a recipe (MP4)

Downtime activities

Downtime activities

Containers

Containers

Ready-made recipes

The easiest way to get started is to import existing recipes.

Tool Recipes (dnd5e)

This module includes the compendium D&D 2024 Tool Recipes: one recipe for every tool that can craft something by the D&D 2024 rules, e.g. "Smith's Tools Recipes".

  1. Import the recipes into your world (they go into the folder "Tools").
  2. Give the players permission to see them.

When crafting, the player chooses what to make from everything the tool can craft.

Create a recipe

Create a recipe

Create a new item and choose "Recipe" (or "AnyOf") as its type.

If the type is missing, enable the Create Beaver's Item Button or see Troubleshooting.

Recipes are recognized by the module, whatever item type your system uses for them, and always open in the recipe sheet. The button System sheet in its header opens your system's own item sheet, e.g. for price, weight or description.

The recipe sheet

Recipe sheet

The header shows the image, the name and the folder of the recipe. The folder groups the recipes in the crafting window and on the actor tab; click it to change it, e.g. Smithing/Weapons.

The sheet follows Foundry's light and dark mode. Every section can be folded; players without edit rights see a read-only version.

Instruction

Flavour text or instructions for the players, e.g. how long the work takes.

Instruction

Required

Items that must be present but are not used up: tools, features, classes, backgrounds …

Cost

Ingredients and money that are used up.

Results

What the crafting gives on success: items, containers, roll tables or macros.

For Required, Cost and Results:

One of

Checks

Optional checks the crafting needs, as numbered steps that are done one after another.

Checks

This example means:

Macro

For advanced users: JavaScript that runs during the crafting, with result, actor and recipeData available.

Plain code runs when the crafting starts. Or write one object with a function per moment, every function is optional:

{
  start() {},                           // the crafting starts
  inputChosen(component, preview) {},   // a cost is chosen, before anything is checked or paid
  resultChosen(component, preview) {},  // a result is chosen, before anything is checked or paid
  finish(success) {}                    // the crafting ends, before the results are given
}

inputChosen and resultChosen can change quantities and money; the crafting window shows these changes as a preview (preview is true there). Throwing an error stops the crafting, it counts as failed.

The sheet has an example to insert; more in Macros.

Example: the cost is half the price of the chosen result (dnd5e)

{
  async resultChosen(component, preview) {
    const item = await fromUuid(component.uuid);
    const price = item?.system.price;
    if (!price?.value) return;
    // half the price in copper, rounded up
    const perGold = CONFIG.DND5E.currencies[price.denomination]?.conversion || 1;
    recipeData.currency = {name: "cp", value: Math.ceil(price.value * 100 / perGold / 2)};
  }
}

Crafting

Players find a new tab on their actor sheet.

Crafting tab

Choose a recipe

Click Craft… to open the crafting window.

Crafting window

Progress

The tab lists everything you are working on, grouped by folder; click a name for details.

If the recipe has checks, the needed resources are locked and you advance by clicking the progress:

Progress

At 100% you get the results. If the crafting fails, you get nothing.

Result

A chat message shows the result.

Result

Items created or updated by a successful crafting are flagged with flags.beavers-crafting.isCrafted = true.

AnyOf

An AnyOf is an ingredient that stands for "any item that …", e.g. any weapon or any herb. Its macro gets an item and returns true when the item matches.

return item.name.startsWith("Test")   // any item whose name starts with "Test"
return item.type === "weapon"         // any weapon (if your system has this type)

The attributes of an item depend on your system. To look at them, use console.log(item); return false and open the console (F12).

Test your AnyOf by dropping an item on its drop area and clicking "test item".

Without code: with the module Item Tags you can filter by tags: return ItemTags.Check(item, ['metal','sword']) (API).

When crafting, choose which item is used for the AnyOf:

An AnyOf that is not chosen yet asks before the crafting starts. Selecting the recipe again starts over.

Hooks

beavers-crafting.start

Fires for every crafting after all components are chosen and before anything is processed. The recipe can be changed here to change the crafting.

Hooks.on("beavers-crafting.start", (recipe) => {
  console.log(recipe);
});

Settings

Create Beaver's Item Button

Adds a button to the Item Directory to create Beaver's Crafting items (Recipe, AnyOf) directly (Foundry v12+). Enable Add Beaver's Item Button in the module settings.

Create Beaver's Item Button

isCrafted flag

Tells crafted items apart from bought or found ones, e.g. a recipe that only accepts crafted daggers. Disabled by default.

Crafted items are marked with an icon.

Crafted icon

Draggable chat result

Results in the chat message can be dragged to another character.

Currency exchange

Money is exchanged automatically (e.g. a gold coin is changed to pay 5 silver). Turn it off to require the exact coins.

Good to know

Troubleshooting

"Recipe" is missing when creating an item

The module adds Recipe and AnyOf to the item creation window. It finds that window by its title, which is "Create New Item" in English.

Create New Item

Solutions, from the easiest:

  1. Enable the Create Beaver's Item Button (Foundry v12+), which does not need the window at all.
  2. Enter the title of your item creation window (in your language) in the module settings.
  3. If your system changes the title, enable capturing in the settings:
    Capture setting
    A bullseye bullseye appears in window headers. Click it in the item creation window; the module remembers that window from then on.

Why so complicated? Foundry has no way for a module to add an item type to every system (not even the module sub-types since v11), so the module adds the entries to the window when it opens.

Credits

Supported Game Systems

  1. Warhammer Fantasy Roleplay 4th / 5th Edition

    Latest Version: Version 10.2.1 Last Updated 12 hours, 28 minutes ago
  2. Pathfinder Second Edition

    Latest Version: Version 8.7.2 Last Updated 1 day, 9 hours ago
  3. Dungeons & Dragons Fifth Edition

    Latest Version: Version 6.1.2 Last Updated 2 days, 17 hours ago
  4. Fabula Ultima

    Latest Version: Version 5.0.0 Last Updated 5 days, 19 hours ago
  5. Level Up: Advanced 5th Edition (Official)

    Latest Version: Version 1.5.3 Last Updated 1 week, 4 days ago
  6. Call of Cthulhu 7th edition

    Latest Version: Version 9.2 Last Updated 2 weeks ago
  7. DnD 4th Edition

    Latest Version: Version 0.9.3 Last Updated 2 months, 2 weeks ago
  8. Systems Without Number (Stars, Cities, and Ashes)

    Latest Version: Version 2.3.3 Last Updated 2 months, 3 weeks ago
  9. Savage Worlds Adventure Edition

    Latest Version: Version 6.0.4 Last Updated 4 months ago
  10. Starfinder First Edition

    Latest Version: Version 14.0.2 Last Updated 4 months, 3 weeks ago
  11. 3.5e for Foundry VTT

    Latest Version: Version 3.1.0 Last Updated 5 months ago
  12. Fallout: The Roleplaying Game

    Latest Version: Version 11.17.1 Last Updated 6 months ago
  13. Cyberpunk RED

    Latest Version: Version v0.92.4 Last Updated 7 months, 3 weeks ago
  14. Pathfinder 1

    Latest Version: Version 11.11 Last Updated 8 months, 2 weeks ago

Categories

Available Versions

  1. Version 4.17.0

    47 minutes ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  2. Version 4.16.2

    1 day, 22 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  3. Version 4.16.1

    2 days, 7 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  4. Version 4.16.0

    2 days, 16 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  5. Version 4.15.1

    3 days, 23 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  6. Version 4.15.0

    4 days, 2 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  7. Version 4.14.0

    5 days, 2 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  8. Version 4.13.0

    6 days, 15 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  9. Version 4.12.2

    6 days, 22 hours ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  10. Version 4.12.1

    1 week ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  11. Version 4.12.0

    1 week ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  12. Version 4.11.0

    1 week, 1 day ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  13. Version 4.10.0

    1 week, 1 day ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  14. Version 4.9.2

    1 week, 1 day ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  15. Version 4.9.1

    1 week, 4 days ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  16. Version 4.9.0

    1 week, 5 days ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  17. Version 4.8.4

    1 week, 6 days ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  18. Version 4.8.3

    2 weeks ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  19. Version 4.8.2

    2 weeks ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  20. Version 4.8.1

    2 weeks ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  21. Version 4.8.0

    2 weeks, 1 day ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  22. Version 4.7.1

    1 month ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  23. Version 4.7.0

    1 month, 3 weeks ago
    Foundry Version 13+ (Verified 14) Manifest URL Read Notes
  24. Version 4.6.2

    8 months, 2 weeks ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  25. Version 4.6.1

    8 months, 3 weeks ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  26. Version 4.6.0

    8 months, 3 weeks ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  27. Version 4.5.2

    9 months ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  28. Version 4.5.1

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  29. Version 4.5.0

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  30. Version 4.4.5

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  31. Version 4.4.4

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  32. Version 4.4.3

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  33. Version 4.4.2

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  34. Version 4.4.1

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  35. Version 4.4.0

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  36. Version 4.3.3

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  37. Version 4.3.2

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  38. Version 4.3.1

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  39. Version 4.3.0

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  40. Version 4.2.1

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  41. Version 4.2.0

    9 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  42. Version 4.1.7

    9 months, 2 weeks ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  43. Version 4.1.6

    11 months, 1 week ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  44. Version 4.1.5

    1 year, 3 months ago
    Foundry Version 11+ (Verified 13.347) Manifest URL Read Notes
  45. Version 4.1.4

    1 year, 3 months ago
    Foundry Version 11+ (Verified 13.347) Manifest URL Read Notes
  46. Version 4.1.3

    1 year, 3 months ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  47. Version 4.1.2

    1 year, 4 months ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  48. Version 4.1.1

    1 year, 5 months ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  49. Version 4.1.0

    1 year, 5 months ago
    Foundry Version 11+ (Verified 13) Manifest URL Read Notes
  50. Version 4.0.15

    1 year, 6 months ago
    Foundry Version 11+ (Verified 13.342) Manifest URL Read Notes
  51. Version 4.0.14

    1 year, 6 months ago
    Foundry Version 11 - 13 (Verified 13.342) Manifest URL Read Notes
  52. Version 4.0.13

    1 year, 7 months ago
    Foundry Version 11 - 13.338 (Verified 12) Manifest URL Read Notes
  53. Version 4.0.12

    1 year, 8 months ago
    Foundry Version 11 - 13 (Verified 13.338) Manifest URL Read Notes
  54. Version 4.0.11

    1 year, 10 months ago
    Foundry Version 11 - 13 (Verified 13.333) Manifest URL Read Notes
  55. Version 4.0.10

    1 year, 10 months ago
    Foundry Version 11 - 13 (Verified 13.333) Manifest URL Read Notes
  56. Version 4.0.9

    1 year, 10 months ago
    Foundry Version 11 - 13 (Verified 13.333) Manifest URL Read Notes
  57. Version 4.0.8

    1 year, 11 months ago
    Foundry Version 11 - 13 (Verified 13.333) Manifest URL Read Notes
  58. Version 4.0.7

    2 years ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  59. Version 4.0.6

    2 years, 2 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  60. Version 4.0.5

    2 years, 2 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  61. Version 4.0.4

    2 years, 2 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  62. Version 4.0.3

    2 years, 2 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  63. Version 4.0.1

    2 years, 2 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  64. Version 4.0.0

    2 years, 2 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  65. Version 3.6.2

    2 years, 3 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  66. Version 3.6.1

    2 years, 3 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  67. Version 3.6.0

    2 years, 3 months ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  68. Version 3.3.3

    2 years, 11 months ago
    Foundry Version 10 - 10 (Verified 10) Manifest URL Read Notes
  69. Version 3.3.2

    2 years, 11 months ago
    Foundry Version 10 - 11 (Verified 11) Manifest URL Read Notes