Create a PaperMC Custom Enchantment with Reedwork in 5 Minutes
By the end of this tutorial, you will have a custom PaperMC enchantment that is automatically discovered and registered by Reedwork.
1. Install Reedwork
Section titled “1. Install Reedwork”First, add Reedwork to your Paper plugin project.
2. Bootstrap Reedwork
Section titled “2. Bootstrap Reedwork”Unlike commands and event listeners, custom enchantments are registered through Paper’s registry system during the bootstrap phase.
Create a PluginBootstrap implementation:
Directorysrc/main/java/
Directorydev.reedworkmc.examples.fiveminuteenchantment
- FiveMinuteEnchantment.java
- FiveMinuteEnchantmentBootstrap.java
package dev.reedworkmc.examples.fiveminuteenchantment;
import dev.reedworkmc.reedwork.Reedwork;import io.papermc.paper.plugin.bootstrap.BootstrapContext;import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
class FiveMinuteEnchantmentBootstrap implements PluginBootstrap {
@Override public void bootstrap(final BootstrapContext context) { // Plugin bootstrap logic Reedwork.bootstrap(context).scan("dev.reedworkmc.examples.fiveminuteenchantment"); }}The bootstrapper is executed during Paper’s bootstrap phase, before the plugin is fully enabled.
It initializes Reedwork and scans the specified package for Reedwork components:
Reedwork.bootstrap(context) .scan("dev.reedworkmc.examples.fiveminuteenchantment");Your paper-plugin.yml must reference the bootstrapper:
name: FiveMinuteEnchantmentversion: '${version}'
main: dev.reedworkmc.examples.fiveminuteenchantment.FiveMinuteEnchantmentbootstrapper: dev.reedworkmc.examples.fiveminuteenchantment.FiveMinuteEnchantmentBootstrapapi-version: '26.2'load: POSTWORLDThis allows Paper to execute FiveMinuteEnchantmentBootstrap during the bootstrap phase.
Because the enchantment is located below the scanned package, Reedwork automatically discovers it.
3. Create the Enchantment
Section titled “3. Create the Enchantment”Create an enchantments package:
Directorysrc/main/java/
Directorydev.reedworkmc.examples.fiveminuteenchantment
- FiveMinuteEnchantment.java
- FiveMinuteEnchantmentBootstrap.java
Directoryenchantments
- ReedworkEnchantment.java
Create ReedworkEnchantment:
package dev.reedworkmc.examples.fiveminuteenchantment.enchantments;
import dev.reedworkmc.reedwork.annotation.Enchantment;import dev.reedworkmc.reedwork.enchantment.CustomEnchantment;import io.papermc.paper.registry.data.EnchantmentRegistryEntry;import io.papermc.paper.registry.keys.tags.ItemTypeTagKeys;import io.papermc.paper.registry.tag.TagKey;import net.kyori.adventure.text.Component;import org.bukkit.inventory.EquipmentSlotGroup;import org.bukkit.inventory.ItemType;
@Enchantment("reedworkinfiveminutes")public class ReedworkEnchantment implements CustomEnchantment {
@Override public Component description() { return Component.text("Reedwork in 5 Minutes"); }
@Override public TagKey<ItemType> supportedItems() { return ItemTypeTagKeys.ENCHANTABLE_ARMOR; }
@Override public int anvilCost() { return 1; }
@Override public int maxLevel() { return 1; }
@Override public int weight() { return 1; }
@Override public EnchantmentRegistryEntry.EnchantmentCost minimumCost() { return EnchantmentRegistryEntry.EnchantmentCost.of(1, 5); }
@Override public EnchantmentRegistryEntry.EnchantmentCost maximumCost() { return EnchantmentRegistryEntry.EnchantmentCost.of(1, 7); }
@Override public EquipmentSlotGroup activeSlots() { return EquipmentSlotGroup.ARMOR; }}The class is marked with:
@Enchantment("reedworkinfiveminutes")This tells Reedwork that the class defines a custom enchantment and uses reedworkinfiveminutes as its registry key.
The class implements CustomEnchantment:
public class ReedworkEnchantment implements CustomEnchantmentCustomEnchantment provides the properties used to define the enchantment.
4. Define the Enchantment
Section titled “4. Define the Enchantment”Description
Section titled “Description”The description is defined using:
@Overridepublic Component description() { return Component.text("Reedwork in 5 Minutes");}This is the name displayed for the enchantment.
Supported Items
Section titled “Supported Items”The enchantment uses:
@Overridepublic TagKey<ItemType> supportedItems() { return ItemTypeTagKeys.ENCHANTABLE_ARMOR;}This means the enchantment is available for items belonging to Paper’s ENCHANTABLE_ARMOR item tag.
Maximum Level
Section titled “Maximum Level”The enchantment has a maximum level of 1:
@Overridepublic int maxLevel() { return 1;}Therefore, the enchantment only has one level.
Anvil Cost and Weight
Section titled “Anvil Cost and Weight”The example defines an anvil cost of 1:
@Overridepublic int anvilCost() { return 1;}Its weight is also 1:
@Overridepublic int weight() { return 1;}These values are part of the enchantment’s Paper registry configuration.
Enchantment Cost
Section titled “Enchantment Cost”The minimum and maximum enchantment costs are defined using Paper’s EnchantmentCost:
@Overridepublic EnchantmentRegistryEntry.EnchantmentCost minimumCost() { return EnchantmentRegistryEntry.EnchantmentCost.of(1, 5);}
@Overridepublic EnchantmentRegistryEntry.EnchantmentCost maximumCost() { return EnchantmentRegistryEntry.EnchantmentCost.of(1, 7);}This defines the cost range used by the enchantment.
Active Equipment Slots
Section titled “Active Equipment Slots”Finally, the enchantment is active on armor slots:
@Overridepublic EquipmentSlotGroup activeSlots() { return EquipmentSlotGroup.ARMOR;}This tells Paper which equipment slots the enchantment applies to.
5. Build and Test
Section titled “5. Build and Test”Build your plugin:
mvn clean packageCopy the resulting JAR from target/ into the plugins/ directory of your Paper server.
Start the server.
During the Paper bootstrap phase, Reedwork scans:
dev.reedworkmc.examples.fiveminuteenchantmentand automatically discovers ReedworkEnchantment.
The enchantment is registered with the key:
minecraft:reedworkinfiveminutesThe enchantment is available as an enchanted book in the Creative Inventory and can be applied to items supported by ENCHANTABLE_ARMOR.
To test the enchantment, hold an applicable item in your main hand and execute:
/enchant @s minecraft:reedworkinfiveminutesThat’s it — you have created a custom PaperMC enchantment with Reedwork without manually registering it with Paper’s registry system.
What You Learned
Section titled “What You Learned”In just a few minutes, you learned how to:
- Add Reedwork to a PaperMC plugin
- Initialize Reedwork during Paper’s bootstrap phase
- Scan your plugin package
- Create a custom enchantment with
@Enchantment - Implement
CustomEnchantment - Define supported items and active equipment slots
- Configure the enchantment level, weight, anvil cost, and enchantment costs
- Let Reedwork automatically discover and register the enchantment
Next Steps
Section titled “Next Steps”Now that you have created your first custom enchantment, explore what else Reedwork can do.
Check out the enchantment documentation for more advanced features, or continue with:
- Commands — create powerful PaperMC commands
- Events — react to Paper/Bukkit events
- Dependency Injection — inject dependencies into your components