Mastercrafted

Mastercrafted

Free
Version: V12
FVTT: V12
Any System
Download
Changelog
    ℹ️

    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 (opens in a new tab) 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
    • If you wish to use a Resource (such as Gold Coins) as an ingredient, you will need to create a Resource Item, see the Creating Resource Items section for more information.

    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

    Creating Resource Items

    If you wish to use Resources as ingredients, you will need to create a Resource Item, this will allow for a recipe to require resources such as Gold Coins, Spell Slots or other resources that are not items.

    • Create a new item
    • Give a name and an image to the item, what you chose here is to your preference
    • In the Header Buttons of the Item Sheet, click on the Duotone Hammer icon
    • In the Attribute Path field, enter the path to the resource you wish to use, the path is relative to the system data path. For example, if you wish to use the Gold Coins resource in the DnD5e system, you would enter currency.gp
    • Keep this item in your Sidebar or in a Compendium, then drag and drop it as any other ingredient in your recipes.

    Using Tags

    Tags are a way to categorize ingridients, by using tags you can have multiple items with different names to be used as a specific ingredient. For example:

    • Create a Gem item
    • In the Header Buttons of the Item Sheet, click on the Duotone Hammer icon
    • Edit the tags to gem
    • Create a Diamond, Ruby, Sapphire items, all with the gem tag
    • In your recipe, set one of the ingridients to be the Gem item - require quantity of 5
    • If the crafting actor has 2 Diamonds 2 Ruby and 5 Sapphire, they will be able to craft and be left with 4 Sapphire
    • An item can have multiple tags separated by a comma
    • Note that due to limitations of the System, a crafting actor cannot chose which item to use from a tag, so if you have multiple items with the same tag, the first one will be used.

    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))

    The Cauldron

    The Cauldron windowThe Cauldron window

    The Cauldron is a special feature that will let your players discover recipes.

    Accessing the Cauldron

    The Cauldron is disabled by default. To access the Cauldron follow these steps:

    • Open the Mastercrafted Module Settings
    • Enable the Cauldron option
    • Open the Mastercrafted Recipe Manager from a Character Sheet
    • Click the Cauldron button on the top right, next to the close button

    Using the Cauldron

    To use the Cauldron, simply drop two or more items in the Cauldron window and click the Mix Ingredients button.

    Depending on the match, you will get a different number of Shakes during the mixing animation and a different chat message.

    Match TypeShakesMessage
    Exact Match4A chat message will ask for the GM confirmation of the discovery
    One Extra Item3It was so close! You almost had it! Maybe you added a little too much.
    One Missing Item3It was so close! You almost had it! Maybe it needs a little bit more.
    Two Extra Items2It looked like it was going to work, but it didn't. Maybe you added too much.
    Two Missing Items2It looked like it was going to work, but it didn't. Maybe it needs more of something.
    One Extra, One Missing2It looked like it was going to work, but it didn't. Maybe you added too much of something and not enough of something else.
    Two or more Missing\Extra Items1Brewing failed! Your concoction did not mix well. The ingredients were consumed.

    Other Cauldron information

    • Anytime you use the Cauldron, all the items will be consumed
    • The Cauldron will not re-discover recipes that you already know
    • The Cauldron will discover recipes that you don't have permission to see
    • Even if a recipe is discovered, you will not recive the results of the recipe.
    • The Cauldron will only consume a single item of each type, so you can use it to discover recipes with items that you only have one of.
    • The Cauldron can discover recipes that require tools you don't have, but you will not be able to craft them.

    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.

    Utility Macros

    Open Recipe Manager

    This will open the Recipe Manager for the selected token, if no token is selected, it will open the Recipe Manager for the assigned character.

    new ui.RecipeApp(actor).render(true);

    Open Cauldron

    This will open the Cauldron for the selected token, if no token is selected, it will open the Cauldron for the assigned character.

    new ui.RecipeApp.CauldronApp(actor).render(true)

    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!

    DND5E Condition Examples

    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 toolID = "herb";
    const DC = 12;
    const result = await actor.rollToolCheck(toolID);
    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,
    }

    PF2E Condition Examples

    Example: Crafting Check

    This macro will execute a crafting check using the Crafting skill. 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.skills.crafting.roll();
     
    return  {
        success: roll.total >= 12,
        consume: true
    };

    Advanced Macros

    For the ones adventurous enough, more information than just the actor is provided to the macro. While no examples will be provided, here is a list with the available variables:

    • actor - The actor doing the crafting
    • componentsToConsume - An array of items that will be consumed after the crafting is done (it's highly suggested to treat this data as read only)
    • product - The product of the crafting (it's highly suggested to treat this data as read only)
    • productData - The data of items that will be crated by the crafting. You can modify these objects and the changes will be reflected in the final product. Note that if you wish to customize the crafting result, Items will still be merged by name, so change the name of the item if you wish to create unique crafting results. Note that you cannot change the length of the array or add new items to it but only modify the existing ones.
    • macroArgs - An array of arguments passed to the macro - to pass arguments use the | separator in the Condition field of the recipe. For example, if you have a macro that requires a number, you can pass it like this: MyMacro|5 and then access it in the macro as macroArgs[0] which will be 5.