Configuration
Configuring enchants.yml
enchants.yml
The enchants.yml
file is the heart of EnchantCore's customization, allowing you to define and modify every aspect of the enchantments available on your server.
File Location: /plugins/EnchantCore/enchants.yml
Structure Overview:
The file is primarily divided into two main sections:
EnchantGUI
: Settings for the main enchantment upgrade GUI.enchants
: A map where each key is a unique identifier for an enchantment (e.g.,efficiency
,explosive_custom
), and its value is a section containing all configurations for that specific enchant.
EnchantGUI
Section:
EnchantGUI
Section:This section controls the appearance and global behavior of the enchantment upgrade menu.
YAML
Title
: The title displayed at the top of the GUI. Supports standard Minecraft color codes (&
) and hex codes (#RRGGBB
).Size
: The number of slots in the GUI. Must be a multiple of 9 (e.g., 9, 18, 27, 36, 45, 54).FillEmptySlots
: Iftrue
, empty slots not occupied by enchantments or static items will be filled with theFillerMaterial
.FillerMaterial
: The Bukkit Material name for the item used to fill empty slots.FillerName
: The display name for filler items. Use " " for a visually empty name.FillerCustomModelData
: If using a resource pack, the custom model data for the filler item.Items
(Static Items - Premium Feature):Define static, non-enchantment items in your GUI (e.g., borders, info buttons, navigation items).
Each key under
Items
(e.g.,border_top
,info_book
) is a unique ID for that static item.Material
: Bukkit Material name.Name
: Display name (supports color codes).Lore
: List of lore lines (supports color codes and placeholders if relevant to context).Slots
: A list of slot numbers (0-indexed) where this item should be placed.CustomModelData
: (Optional) For resource packs.Amount
: (Optional, defaults to 1) Number of items in the stack.CommandsOnClick
: (Optional) A list of commands to execute when this static item is clicked.Prefix with
console:
to run as console (e.g.,console: eco give %player% 100
).Prefix with
player:
or no prefix to run as player (e.g.,player: warp help
).%player%
placeholder is available.
enchants
Section - Defining Enchantments:
enchants
Section - Defining Enchantments:This is where you define each individual enchantment. Each enchantment has its own section, keyed by a unique identifier you choose (e.g., efficiency
, my_explosive_enchant
).
Example Structure for one Enchantment:
YAML
Key Enchantment Parameters Explained:
RawName
(Required): The internal, unique ID for the enchantment. Must be all lowercase with no spaces (underscores or hyphens are okay). This is used for commands, storing data (PDC), and identifying the enchant in other configs. Cannot be changed once set without data loss.Name
(Required): The display name of the enchantment, shown in messages, chat, and potentially in lore via placeholders. Supports color codes.GuiName
(Optional): The name shown for the item in the GUI. If omitted, it defaults to theName
. The player's current level for that enchant is automatically appended to this in the GUI.Material
(Required): The Bukkit Material name for the item that represents this enchantment in the GUI (e.g.,DIAMOND_SWORD
,TNT
,EXPERIENCE_BOTTLE
).Base64
(Optional): For using custom player heads as icons. Provide the Base64 texture value here. If valid, this will override theMaterial
.CustomModelData
(Optional): An integer value for custom model data if you are using a resource pack to change item appearances. Defaults to 0.Enabled
(Required): Set totrue
for the enchantment to be loaded and usable. Set tofalse
to disable it.InGuiSlot
(Required): The numerical slot where this enchantment will appear in the/enchant
GUI (0 is the top-left slot). Use -1 if you want the enchant to be active but not visible in the GUI (e.g., hidden admin enchants, or enchants only obtainable via commands).MaxLevel
(Required): The maximum level this enchantment can reach. Must be 1 or greater. A value of 0 is typically interpreted by the plugin as effectively unlimited, though there might be an internal hard cap.Cost
(Required): The base cost (in Tokens or Vault currency, depending onconfig.yml
) to acquire Level 1 of this enchantment (or to upgrade from Level 0 to 1).IncreaseCostBy
(Required):This value controls how the cost increases with each level. It works differently depending on the CostFormula you choose:
LINEAR The cost goes up by a fixed amount every level. Formula:
Cost = BaseCost + IncreaseCostBy × (Level - 1)
Example: IfBaseCost = 100
andIncreaseCostBy = 50
, then Level 1 = 100, Level 2 = 150, Level 3 = 200, and so on.EXPONENTIAL The cost multiplies each level, growing faster over time. Formula:
Cost = BaseCost × (IncreaseCostBy ^ (Level - 1))
Example: IfBaseCost = 100
andIncreaseCostBy = 1.1
, then Level 1 = 100, Level 2 = 110, Level 3 = 121, and so on.
💡 For exponential growth, use a value greater than 1.0 (like
1.1
) to make the cost increase with each level.
CostFormula
(Required): Defines how the cost scales.LINEAR
: Additive increase.EXPONENTIAL
: Multiplicative increase.
PickaxeLevelRequired
(Required): The minimum level the player's EnchantCore Pickaxe must be before they can purchase or upgrade this specific enchantment. Set to 0 if there's no pickaxe level restriction.MinecraftEnchantKey
(Optional): If this custom enchantment should also apply a corresponding vanilla Minecraft enchantment effect (e.g., your custom "Super Efficiency" also gives vanilla Efficiency), specify the vanilla key here (e.g.,minecraft:efficiency
,minecraft:looting
). The plugin will attempt to apply this vanilla enchant to the pickaxe alongside its custom effects.Description
(Optional): A list of strings providing a general description of the enchant. This can be used in lore with the%description%
(for the first line) or%description_multiline%
(for all lines joined) placeholders.lore
(Required): A list of strings that define the lore for this enchantment's item in the GUI. This is highly customizable.Supports color codes (
&
and#RRGGBB
).Supports various Placeholders (see below).
Settings
(Optional): A sub-section for enchantment-specific parameters. The available settings depend on the enchantment's type and how it's coded in the Java part of the plugin. Common examples are provided above (Chance, Radius, Duration, Rewards, Commands, etc.).
Common Lore Placeholders:
When defining the lore
for an enchantment item in the GUI, you can use these placeholders:
%enchant_name%
: The displayName
of the enchantment.%current_level%
or%level%
: The player's current level for this enchantment.%max_level%
: TheMaxLevel
defined for this enchantment.%cost%
: The cost to upgrade to the next level. Displays "Maxed" or "N/A" appropriately.%pickaxe_level_required%
: ThePickaxeLevelRequired
for this enchant.%description%
: The first line from the enchant'sDescription
list.%description_multiline%
: All lines from the enchant'sDescription
list, joined.
Placeholders from Settings
(Examples - depend on what your Java code looks for):
%chance%
: TypicallyChanceBase
+ (ChanceIncreasePerLevel
* level), formatted as a percentage.%radius%
: Current radius of an AoE enchant.%duration%
: Current duration of a timed enchant.%multiplier%
: Current multiplier of a booster enchant.%min_amount%
: Minimum reward amount for the current level.%max_amount%
: Maximum reward amount for the current level.(Your plugin's Java code for
EnchantmentWrapper.applyPlaceholdersToLine()
determines exactly which placeholders from theSettings
section are processed and how).
Creating Your Own Enchantments ((Command Based Only)Premium Feature)
With EnchantCore-Premium, you can create custom enchantments that run commands when triggered. These enchantments do not require any Java coding and can be added directly in the enchants.yml
file.
You can add as many of these command-based enchantments as you like. Just make sure the action is limited to executing commands.
For example, the VoucherFinder
enchantment gives players a voucher while they are mining by simply executing a command. You can define how often it triggers, what command it runs, and customize messages or rewards.
To create your own (you can just copy and paste the voucherfinder enchant):
Add a new section under
enchants:
Give it a unique
RawName
likeAnotherKeyAllEnchant
Fill out required fields such as
Name
,Material
,MaxLevel
, andCost
Under
Settings
, specify the command you want to run when the enchant activates
Since these enchants are based on command execution, there is no need to touch the plugin’s Java code. Everything can be controlled through configuration.
Make sure to back up your enchants.yml
file before making any changes.
Always back up your enchants.yml
before making significant changes! Refer to the Java documentation or specific examples for how to make new enchant Settings
readable by the plugin if you are developing custom Java handlers.
Last updated