diff --git a/docs/documentation/library/0.0.1-alpha/use-custom-enchantments.markdown b/docs/documentation/library/0.0.1-alpha/use-custom-enchantments.markdown new file mode 100644 index 0000000..0cf9b59 --- /dev/null +++ b/docs/documentation/library/0.0.1-alpha/use-custom-enchantments.markdown @@ -0,0 +1,28 @@ +--- +layout: doc +title: "Use Custom Enchantments" +--- + +Use `CustomEnchantment` allow you to set a EnchantmentType for your Enchantment. You can also easly register your Enchantment with `CustomEnchantment#register`. + +`Enchantments.java` +```java +public class Enchantments implements ElementsInitializer { + + public static CustomEnchantment enchantment = new CustomEnchantment( + EnchantmentType.DEFAULT, // The Enchantment Type + Enchantment.Rarity.COMMON, // The Enchantment Rarity + EnchantmentTarget.BREAKABLE, // The Enchantment Target + EquipmentSlot.MAINHAND // The Equipment Slot + ); + + public void register() { + enchantment.register(new Identifier("mmodding_exemple_mod", "mmodding_enchantment")); + } +} +``` + +
Tip: `EnchantmentType.DEFAULT` represents a normal enchantment.
+
Tip: Enchantment Rarity can be: `COMMON` `UNCOMMON` `RARE` `VERY_RARE`.
+
Tip: Enchantment Target can be: `ARMOR` `ARMOR_FEET` `ARMOR_LEGS` `ARMOR_CHEST` `ARMOR_HEAD` `WEAPON` `DIGGER` `FISHING_ROD` `TRIDENT` `BREAKABLE` `BOW` `WEARABLE` `CROSSBOW` `VANISHABLE`.
+
Tip: Equipment Slot can be: `MAINHAND` `OFFHAND` `FEET` `LEGS` `CHEST` `HEAD`.
diff --git a/docs/documentation/library/0.0.1-alpha/use-custom-enchantments/enchantment-type.markdown b/docs/documentation/library/0.0.1-alpha/use-custom-enchantments/enchantment-type.markdown new file mode 100644 index 0000000..d216c57 --- /dev/null +++ b/docs/documentation/library/0.0.1-alpha/use-custom-enchantments/enchantment-type.markdown @@ -0,0 +1,29 @@ +--- +layout: doc +title: "Enchantment Type" +--- + +## Several features may not work properly. + +You can create your own EnchantmentType by this way: + +`EnchantmentTypes.java` +```java +public class Enchantments implements ElementsInitializer { + + public static EnchantmentType type = EnchantmentType.createWithCustomBook( + // The Name of the EntityType + "mmodding_enchantment_type", + // The Prefix Before the Book Item Name for All The Enchanted Books with this EnchantmentType + Text.of("ยง4 MModding Enchantment Type"), + // Can the Enchantments with this EnchantmentType be in the Enchanting Table + false, + // The Identifier for the CustomBookItem + new Identifier("mmodding_exemple_mod", "mmodding_enchantment_book"), + // Item Settings for the CustomBookItem + new CustomItemSettings.glint() + ); + + public void register() {} +} +```