Craftings Tutorial

In this page you will find all properties of craftings configuration files. Everytime you modify something in these files you must reload the plugin using /ecraft reload.

Craftings are stored in the craftings folder. However, if you want to, you can create subfolders, and place craftings files inside so you can organize everything in a better way (per category for example). Useful when having a lot of craftings.

Item

This is the item to be crafted. It is automatically saved when using /ecraft create but you can modify its options (only if you DON'T save the item using /ecraft create <name> original). If you want to do so click HERE to read how.

All items in the plugin (except required items), even the ones placed in the inventories.yml file follow the same structure and contain the same properties.

item:
  id: BOW
  name: "&d&lMystic Bow"
  enchants:
  - DAMAGE_ARTHROPODS;2
  - ARROW_DAMAGE;3

Category

All craftings must belong to a category which is specified in this option. Must be a valid category name from the categories.yml file.

category: weapons_armor

Requires

These are the required items to craft the main item. They are automatically saved when using /ecraft create. I don't recommend you to modify them manually since it is more difficult than editing the main item. If you want to change them use /ecraft edit <name>.

Very important information:

The plugin uses different item properties when checking for required items in players inventories. These properties are:

  • Item id

  • Item durability/datavalue

  • Item name

  • Item lore

  • Item enchants

  • Item custom model data

  • Item potion data

  • Item book enchants

You manually add the "dont_remove" property at the end of a required item line, to prevent this item being removed from the player inventory.

requires:
- 'id:DIAMOND;amount:15;name:&bUnique Diamond;lore:&7A legendary mineral|&7very hard to obtain..'
- 'id:IRON_INGOT;amount:10'
- 'id:CHEST;amount:5;dont_remove'

You can also manually add the "hide_flags" property at the end of a required item line, to hide all the flags from this item in particular.

requires:
- 'id:DIAMOND_SWORD;amount:1;hide_flags'

You can completely remove the 'requires' option, meaning the crafting will not need required items and instead you can use extra requirements.

Priority

Since craftings are stored in they own file, there is no way to order them in the inventory. That's why you can use the priority option. A higher priority number means it will be placed at last. Each time you create a new crafting using the /ecraft create command, a higher priority number (higher than the last crafting from this category) is automatically selected.

priority: 4

Cooldown

You can set a cooldown to a crafting, meaning the player will have to wait until the item/crafting is created. The cooldown is set in seconds.

Op players or players with the ecraft.bypass.cooldowns permission will completely bypass this cooldown.

cooldown: 7200

Cooldown Bypass Cost

You can add this option to allow players to bypass the cooldown using money. You need Vault for this option to work. To bypass the cooldown players will need to RIGHT CLICK on the crafting, this will open the bypass_cooldown_menu inventory from inventory.yml file.

cooldown_bypass_cost: 5000

Permission

This option allows you to set a permission to craft this item.

permission: ecraft.supersword

Permission Error Message

If this option is present, a custom error message will be send (instead of the default one) when trying to open the crafting but the player doesn't have permissions.

permission_error_message:
- "&c-----------------------------------"
- "&cYou need more wisdom to craft this!"
- "&c-----------------------------------"

Save Original Item

Whether the item to craft should be saved as an EXACT COPY of the original item. You should not modify this option, and let the plugin add it to the config automatically when using /ecraft create <name> original. Click HERE to know more.

save_original_item: false

One Time

If you set this option to true, players will be able to craft this item just one time.

one_time: true

One Time Error Message

If this option is present, a custom error message will be send (instead of the default one) when trying to open the crafting but the player already crafted it and one time is enabled.

one_time_error_message:
- "&cYou've already crafted this magic sword!"

Craft With Money

Adding this option will let players buy the item instead of crafting it. This will add the craft_with_money custom item from inventories.yml file. You need Vault for this option to work.

Players will need the ecraft.use.craftwithmoney permission to craft with money.

craft_with_money: 5000

Hide Required Items Flags

You can set this option to true to completely hide all required item flags, like attributes, enchantments, potion data, etc. This is only visual.

hide_required_items_flags: true

Ignore Required Items Properties

These options will allow players to craft the item, ignoring some required items properties. For example, if the required item is a Diamond, and you want players to be able to use regular diamonds but also enchanted diamonds, then you must set ignore_required_items_enchants on true.

ignore_required_items_name: true
ignore_required_items_datavalue: true
ignore_required_items_lore: true
ignore_required_items_enchants: true
ignore_required_items_custom_model_data: true

Success Rate

This will add a probability of success to the crafting. For example, if the chance is set to 25 it means that there will be a 75% of chance to fail, and lose the used items. On the fail_actions property you can use all EpicCraftingsPlus actions found HERE. These actions will be executed if the player fails creating the crafting.

success_rate:
  chance: 25
  fail_actions:
  - "message: &cThe creation of the &2Magic &dKey &cfailed! The Mystery Vaults can't be opened yet..."
  - "playsound: BLOCK_NOTE_BLOCK_PLING;10;0.1"

Actions When Crafted

For each crafting you can specify different actions to be executed when the player craft the item. This allows you to craft not only items but commands (maybe to give money or execute custom console commands to the player). You can use all EpicCraftingsPlus actions found HERE.

actions_when_crafted:
- "console_command: broadcast &2&l%player% crafted a &4&lSUPER SWORD&2&l!" 
- "firework: colors:YELLOW,RED type:BALL fade:AQUA power:0"
actions_when_crafted:
- "[count_as_item]console_command: complexturrets give Burst_Turret %player%"

You can add the [count_as_item] prefix before an action to make the action require an empty slot on the player inventory.

Actions When Cooldown Starts

You can optionally add actions to execute when the player consumes the required items and the cooldown for the crafting starts. You can use all EpicCraftingsPlus actions found HERE.

actions_when_cooldown_starts:
- "console_command: eco take %player% 1000"

No Item

If you are using the Actions when Crafted property, sometimes you will only want to execute a console command instead of giving an item. If you set this option to true, the player will not receive the item.

no_item: true

Extra Requirements

Information about this option HERE.

Random Craftings

This option allows a crafting to give a random crafting to the player when created. You must use the following format: <crafting_name>;<probability>. The <crafting_name> should be an already created crafting. It's not necessary that probabilities sum 100%.

random_craftings:
- "super_sword;20"
- "king_helmet;30"
- "epic_bow;50"

Requires Lore Custom Character

You can add this option to craftings and choose an alternative character (like '-') to separate lore lines of required items in the file. This will help you if you are using the default separation lore character ('|') in the lore of a required item.

requires_lore_custom_character: "-"
requires_lore_custom_character: "{"

Last updated