Mastercrafted

Mastercrafted

Free
Version: V13
FVTT: V13
Any System
Download
Changelog

    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!

    Getting Started

    ℹ️

    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!

    Your first Recipe

    • Open the Recipe Manager from the Items sidebar
    • Add a Book with the Add Recipe Book button
    • Add a Recipe to the Book by right clicking on it and selecting Add Recipe
    • Toggle Edit Mode by checking the Edit checkbox on the top right of the Recipe
    • Drag and Drop one or more items to the ingredients section
    • Drag and Drop an item to the result section
    • You have created your first Recipe!

    Craft your first Item

    • Make sure you have an actor with the necessary ingredients in the inventory
    • Open the Recipe Manager from the Items sidebar
    • Select the Recipe
    • Click the Craft button (the image of the Recipe)
    • You have crafted your first Item!
    Recipe Manager buttonRecipe Manager button

    Advanced

    Configuring a recipe

    The Main Mastercrafted WindowThe Main Mastercrafted Window
    • Drag and Drop ingredients to the + panel to add a new ingredient. Dragging multiple ingredients in the same panel will let the player chose which one to use from that panel for the crafting.
    • Clicking on the + of an existing panel adds an empty item to the panel and opens the item configuration sheet.
    • 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.
    • Right click to open a context menu with options to inspect, edit or remove an ingredient.
    • If you wish to use a Resource (such as Gold Coins or HP) as an ingredient, you will need to create a Resource Item, see the Creating Resource Ingredients section for more information.
    • If you wish for an ingredient to accept items with different names you can add Tags to it. Check the Using Tags section for more information.
    • NOTE: Resource Ingredients ingredients will only be matched against their resource. All other ingredients will be matched against their name first, then their Tags. UUID is only used to inspect the item when clicking Inspect and has no effect on crafting.

    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.
    • Right click to open a context menu with options to inspect and remove the result.

    Importing\Exporting

    • As with all Journals and Journal Pages, you can export a Book or a Recipe by right clicking on it and selecting the export or import option in the context menu.
    Button in the Actor SheetButton in the Actor Sheet

    Creating Resource Ingredients

    If you wish to use Resources as ingredients, you will need to create a Resource Ingredient, 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 ingredient
    • Give a name and an image to the ingredient, what you chose here is to your preference
    • In the Resource 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
    • A Resource Ingredient requirement in a recipe can only be fullfilled by the chosen resource. Tags and item name are ignored for Resource Ingredients.

    Using Tags

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

    • Create a Diamond, Ruby, Sapphire items
    • In the title bar of the Item Sheet, click on the three dots and then on "Mastercrafted - Item Configuration"
    • Add gem to the Tags field. They are now considered gem items
    • Create a Precious Gem ingredient in your recipe
    • Set the ingredient to require a gem item by adding gem to its Tags field
    • Set its quantity to 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
    • Both items and ingredients can have multiple tags
    • You can choose if all ingredient tags (Every) or at least one of them (Some) are required for an item to be considered as a valid ingredient
    • If you add an ingredient by dragging and dropping an item in the Recipe, its tags will be copied to the ingredient
    • Tags will be checked after the ingredient name. If you have some items named Precious Gem in you inventory, they will be used before any gem tagged item
    • 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 Mastercrafted from the Items sidebar
    • Select a Book
    • 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)
    • Right click to inspect ingredients\results
    • Left click to select a different ingredient from an ingredient panel
    • Left click a result panel to select the desired result
    • The Craft button is on the image of the Recipe, in the top left.
    • Hold ctrl to skip confirmation
    The crafting windowThe crafting window

    Choosing a Crafting Actor

    • Players can specify which owned actor to use for crafting and which actor's inventory to use for ingredients by selecting them with the Craft as and Use Inventory dropdowns.
    • The Craft as actor will be checked for the Required tools, any ability/skill checks and Resource Ingredients.
    • The Use Inventory actor will provide all other ingredients for the crafting.
    • Crafting results will be added to the Use Inventory actor's inventory.

    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 Timekeeping & Calendar (opens in a new tab).

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

    game.modules.get("mastercrafted").API.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.

    Utility Macros

    Open Recipe Manager

    This will open the Recipe Manager. If filter is provided, the Search field will be populated with the filter. If actor is provided, the Recipe Manager will be opened with that actor as the Craft As actor.

    new (game.modules.get("mastercrafted").API.RecipeBookApplication)(filter, actor).render({ force: 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 (game.modules.get("mastercrafted").API.CauldronApp)(actor).render({ force: true })

    Checks (DND5E Only)

    For the D&D5E system, a dropdown with ability/skill checks and tool checks are available with corresponding DC.

    • The tool name is Case Sensitive
    • Failing the check will result in consumed Ingredients but no rewards

    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, modifier: Number (optional) }
    • success determines if the crafting is successful or not while consume determines if the ingredients are consumed in the event of a failed craft
    • checkResult is an optional number that will be used as a roll result for triggering a Modifier. Note that if Checks are used, this value will be overwritten by the result of the last Check.
    • timeMultiplier is an optional number that will be used to multiply the time of delayed craftings.
    • In the context of the macro, actor is the Actor doing the crafting while inventoryActor is the actor that will be used as the crafting inventory.
    • 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!

    Modifiers

    You can add as many modifiers as you need. If either the check roll result or the value returned by the condition in { modifier: Number (optional) } is equal to or greater than the DC (using the higher value), the number of items crafted is multiplied by the result of the modifier expression. You may include a mathematical operator at the beginning of the modifier; if none is provided, a plus (+) is assumed by default.

    • Example: Modifier: *1d4 - DC: 20, Expression result: 22 multiplies the number of crafted items by 1d4

    DND5E Condition Examples

    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. The roll result will be checked against the DCs in the Modifiers section.

    const toolID = "herb";
    const DC = 12;
    const rolls = await actor.rollToolCheck({tool: toolID});
    return {
        success: rolls[0].total >= DC,
        consume: true
        timeMultiplier: rolls[0].total,
        checkResult: rolls[0].total,
    };

    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. The roll result will be checked against the DCs in the Modifiers section.

    const roll = await actor.skills.crafting.roll();
     
    return  {
        success: roll.total >= 12,
        consume: true
        timeMultiplier: rolls[0].total,
        checkResult: rolls[0].total,
    };

    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 currently set as Craft As actor
    • inventoryActor - The actor currently set as Use Inventory actor
    • 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.