tutorial:enchantments
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
tutorial:enchantments [2019/07/02 20:13] – finished class creation section draylar | tutorial:enchantments [2019/07/02 20:17] – finished registry section draylar | ||
---|---|---|---|
Line 81: | Line 81: | ||
</ | </ | ||
+ | ==== Registering Enchantment ==== | ||
+ | Registering enchantments follows the same process as usual: | ||
+ | <code java [enable_line_numbers=" | ||
+ | private static Enchantment WRATH; | ||
+ | @Override | ||
+ | public void onInitialize() | ||
+ | { | ||
+ | WRATH = Registry.register( | ||
+ | Registry.ENCHANTMENT, | ||
+ | new Identifier(" | ||
+ | new WrathEnchantment( | ||
+ | Enchantment.Weight.VERY_RARE, | ||
+ | 0, | ||
+ | EquipmentSlot.MAINHAND | ||
+ | ) | ||
+ | ); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | This registers our enchantment under the namespace '' |
tutorial/enchantments.txt · Last modified: 2023/01/04 13:52 by datsuns