Skip to content

Commit

Permalink
0.1.0-alpha weird docs are pushed
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed May 10, 2024
1 parent 18f8927 commit dc983d1
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
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>
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() {}
}
```

0 comments on commit dc983d1

Please sign in to comment.