Mastercrafted

Mastercrafted

Premium
Version: undefined
FVTT: V11
Download
ℹ️

Want to start with some already made recipes and gathering points?
Download the DnD5e Potion Crafting & Gathering (opens in a new tab) module by Action_Jay using this (opens in a new tab) ManifestURL! The module leverages both the Mastercrafted and Gatherer modules. Make sure you install both!

A simple yet effective crafting module for any system, create books, recipes, export and share! Make recipes with different outcomes or that can require alternate ingredients! Set permissions to specific players, require tools to craft and more!

Creating and Editing Recipes

Creating a new Book and Recipe

Recipe Manager buttonRecipe Manager button
  • To open the Recipe Manager, click the button located in the Items Sidebar Tab
  • Use the "Add Recipe Book" button to create a new book, configure as needed
  • Right click a book to add a recipe, left click a book to expand it
  • Click the newly created recipe to open it

Configuring a recipe

The Main Mastercrafted WindowThe Main Mastercrafted Window
  • Drag and Drop ingredients in the + panels. Dragging multiple ingredients in the same panel will let the player chose which one to use from that panel for the crafting
  • Having multiple ingredient panels means that at least one item from each panel will be required for the crafting.
  • You can edit the required quantity in on the top right of the ingredient
  • Left click an ingredient to inspect, right click to remove it from the recipe

Creating a crafting result

The Recipe panel in Edit ModeThe Recipe panel in Edit Mode
  • Drag and drop items in the result + panels
  • Having multiple items in a single result panel will award the player with all the items when crafting
  • If you have multiple result panels, the player will be able to chose which panel will be the result of the crafting
  • Left click a result to inspect, right click to remove it from the recipe

Importing\Exporting

  • Right click a recipe or book to export it
  • Right click a recipe or book to import from a json and overwrite it
Button in the Actor SheetButton in the Actor Sheet

Crafting

  • Open an Actor Sheet
  • Click the Crafting button in the window header
  • Select a Recipe (Keep in mind that as a GM you will always see all recipes, make sure you give the correct permissions to players in the book/recipe configuration)
  • Left click to inspect ingredients\results
  • Right click to select a different ingredient from an ingredient panel
  • Left click a result panel to select the desired result
  • Click the Craft button on the top right to craft, hold ctrl to skip confirmation
The crafting windowThe crafting window

Timed Crafting

⚠️

To avoid checking all actors on a regular basis which would cause network slowdowns and server strain, timed crafting will be processed whenever you open an actor sheet for that actor only.

Recipes accept a time option, which is time in minutes. Keep in mind that this option will work based on world time so you will need some other module that handles time passing for it to work. Such modules include Simple Calendar (opens in a new tab) and/or Small Time (opens in a new tab).

If you wish to manually process timed crafting, you can use this macro.

ui.RecipeApp.processDelayedCrafting(Array.from(game.actors).filter(a => a.isOwner))

Document Links

At the moment it's not possible to create links in journals\chat to recipes by drag and dropping them. The current Foundry API requires heavy core code modifications to achieve this, so it's on hold until the API is improved.

You can however manually create links to recipes by using the following syntax:

@mastercrafted[BookName.RecipeName]

Replace BookName and RecipeName with the name of the book and recipe you want to link to. If the recipe name is omitted, the link will point to the book instead.

Advanced: Adding conditions to crafting

Adding conditions will allow you to add custom checks to crafting, for example making a strength check in order to make an item (in addition to other conditions). We will use the DND5E System in this example but it will work with any system, refer to your system discord channel or macro polo to know the correct macro commands for checks.

  • Create a new script macro, for this example we will call it StrengthCheck
  • Edit the recipe and type the exact macro name in the Condition field
  • The macro will need to return an object { success: Boolean, consume: Boolean }
  • success determines if the crafting is successful or not while consume determines if the ingredients are consumed in the event of a failed craft
  • In the context of the macro, actor is the Actor doing the crafting.
  • You can copy paste this sample macro to use as a template for your own
  • Note: You can also copy paste the macro code directly in the Condition field, but make sure your lines correctly end with ; as the code will be collapsed to a single line!

Example: Ability Test

This macro for DnD5e shows how you can make a strength check and return the result. If the check is successful, the crafting will be successful and the ingredients will be consumed. If the check fails, the crafting will fail and the ingredients will still be consumed.

const roll = await actor.rollAbilityTest('str');
 
return {
  success: roll.total > 12,
  consume: true,
};

Example: Tool Check

This macro for DnD5e shows how you can make a tool check and return the result. If the check is successful, the crafting will be successful and the ingredients will be consumed. If the check fails, the crafting will fail and the ingredients will still be consumed.

const toolName = "Alchemist's Supplies";
const DC = 12;
 
const tool = actor.items.getName(toolName);
const result = await tool.rollToolCheck();
return  {
    success: result.total >= DC,
    consume: true
};

Example: Require and Consume a Spellslot

This macro for DnD5e shows how you can check if the actor has a spellslot and consume it if they do. If they don't have a spellslot, it will show an error message and prevent the crafting from happening.

const hasSpellslot = actor.system.spells.spell1.value > 0;
if(!hasSpellslot){
ui.notifications.error("No Spellslot")
    return {
        success: false,
        consume: false,
    };
}
await actor.update({'system.spells.spell1.value': actor.system.spells.spell1.value - 1});
 
return {
    success: true,
    consume: true,
}