Add item lore data for special stats.
Adds spawn egg drop chance Adds custom enchantment
This commit is contained in:
parent
28c60f3a53
commit
e7e08902f0
17 changed files with 408 additions and 68 deletions
|
@ -0,0 +1,42 @@
|
|||
package dev.zontreck.otemod.enchantments;
|
||||
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentCategory;
|
||||
|
||||
public class MobEggEnchantment extends Enchantment
|
||||
{
|
||||
|
||||
public MobEggEnchantment()
|
||||
{
|
||||
super(Rarity.VERY_RARE, EnchantmentCategory.WEAPON, new EquipmentSlot[] {EquipmentSlot.MAINHAND});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinCost(int level)
|
||||
{
|
||||
return 28 + (level - 1) * 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCost(int level)
|
||||
{
|
||||
return this.getMinCost(level) + 15;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canApplyAtEnchantingTable(ItemStack stack)
|
||||
{
|
||||
return super.canApplyAtEnchantingTable(stack);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package dev.zontreck.otemod.enchantments;
|
||||
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class ModEnchantments {
|
||||
public static final DeferredRegister<Enchantment> REGISTERS = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, OTEMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Enchantment> MOB_EGGING_ENCHANTMENT = REGISTERS.register("mob_egging", ()->new MobEggEnchantment());
|
||||
|
||||
public static void register(IEventBus bus){
|
||||
REGISTERS.register(bus);
|
||||
}
|
||||
}
|
Reference in a new issue