-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18f8927
commit dc983d1
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
docs/documentation/library/0.0.1-alpha/use-custom-enchantments.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")); | ||
} | ||
} | ||
``` | ||
|
||
<div class="notification is-success">Tip: `EnchantmentType.DEFAULT` represents a normal enchantment.</div> | ||
<div class="notification is-success">Tip: Enchantment Rarity can be: `COMMON` `UNCOMMON` `RARE` `VERY_RARE`.</div> | ||
<div class="notification is-success">Tip: Enchantment Target can be: `ARMOR` `ARMOR_FEET` `ARMOR_LEGS` `ARMOR_CHEST` `ARMOR_HEAD` `WEAPON` `DIGGER` `FISHING_ROD` `TRIDENT` `BREAKABLE` `BOW` `WEARABLE` `CROSSBOW` `VANISHABLE`.</div> | ||
<div class="notification is-success">Tip: Equipment Slot can be: `MAINHAND` `OFFHAND` `FEET` `LEGS` `CHEST` `HEAD`.</div> |
29 changes: 29 additions & 0 deletions
29
...mentation/library/0.0.1-alpha/use-custom-enchantments/enchantment-type.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} | ||
} | ||
``` |