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 [2020/07/03 18:36] – more formatting fixes draylar | tutorial:enchantments [2020/07/03 19:02] – draylar | ||
---|---|---|---|
Line 10: | Line 10: | ||
==== Creating Enchantment Class ==== | ==== Creating Enchantment Class ==== | ||
- | Our new enchantment is called //Frost// and slows mobs on hit. The slowness effect, durability, and potency will grow relative to the level of the enchantment. In our enchantment class, we pass up '' | + | Our new enchantment is called //Frost// and slows mobs on hit. The slowness effect, durability, and potency will grow relative to the level of the enchantment. In our enchantment class, we pass up '' |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
public class FrostEnchantment extends Enchantment { | public class FrostEnchantment extends Enchantment { | ||
public FrostEnchantment() { | public FrostEnchantment() { | ||
- | super(Enchantment.Rarity.VERY_RARE, EnchantmentTarget.WEAPON, | + | super(Enchantment.Rarity.UNCOMMON, EnchantmentTarget.WEAPON, |
} | } | ||
} | } | ||
Line 22: | Line 22: | ||
We will now override a few basic methods for basic functionality: | We will now override a few basic methods for basic functionality: | ||
- | '' | + | '' |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
@Override | @Override | ||
Line 69: | Line 69: | ||
</ | </ | ||
- | This registers our enchantment under the namespace '' | + | This registers our enchantment under the namespace '' |
==== Adding Translations & Testing ==== | ==== Adding Translations & Testing ==== |
tutorial/enchantments.txt · Last modified: 2023/01/04 13:52 by datsuns