How do I create an enchantment? #3878
Answered
by
Jark5455
wangziwenhk
asked this question in
FAQ
-
VersionMinecraft: 1.21 ProblemI try to create an enchantment like Wiki does public class FrostEnchantment extends Enchantment {
public FrostEnchantment() {
super(Enchantment.Rarity.UNCOMMON, EnchantmentTarget.WEAPON, new EquipmentSlot[] {EquipmentSlot.MAINHAND});
}
} But I don't have the class EnchantmentTarget, and Enchantment.Rarity.UNCOMMON is actually incorrect, it should be Rarity.UNCOMMON, and this constructor is also problematic I want to know what should I do? |
Beta Was this translation helpful? Give feedback.
Answered by
Jark5455
Jun 23, 2024
Replies: 1 comment 1 reply
-
Are you using 1.21? Now enchantments are data-driven and have to be created through datapacks or registries |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
wangziwenhk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you using 1.21? Now enchantments are data-driven and have to be created through datapacks or registries