Class EnchantmentLifeStealing
java.lang.Object
net.minecraft.world.item.enchantment.Enchantment
org.cyclops.evilcraft.enchantment.EnchantmentLifeStealing
- All Implemented Interfaces:
net.minecraftforge.common.extensions.IForgeEnchantment
public class EnchantmentLifeStealing
extends net.minecraft.world.item.enchantment.Enchantment
Enchantment that steals the HP when hit another Entity.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.enchantment.Enchantment
net.minecraft.world.item.enchantment.Enchantment.Rarity -
Field Summary
Fields inherited from class net.minecraft.world.item.enchantment.Enchantment
category, descriptionId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetMaxCost(int level) intintgetMinCost(int level) static voidstealLife(net.minecraft.world.entity.LivingEntity entity, float damage, int level) Transfer the damage dealt as HP to the attacking entity.voidstealLife(net.minecraftforge.event.entity.living.LivingAttackEvent event) Methods inherited from class net.minecraft.world.item.enchantment.Enchantment
byId, canApplyAtEnchantingTable, canEnchant, checkCompatibility, doPostAttack, doPostHurt, getDamageBonus, getDamageProtection, getDescriptionId, getFullname, getMinLevel, getOrCreateDescriptionId, getRarity, getSlotItems, isAllowedOnBooks, isCompatibleWith, isCurse, isDiscoverable, isTradeable, isTreasureOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraftforge.common.extensions.IForgeEnchantment
getDamageBonus
-
Constructor Details
-
EnchantmentLifeStealing
public EnchantmentLifeStealing()
-
-
Method Details
-
stealLife
public void stealLife(net.minecraftforge.event.entity.living.LivingAttackEvent event) -
getMinCost
public int getMinCost(int level) - Overrides:
getMinCostin classnet.minecraft.world.item.enchantment.Enchantment
-
getMaxCost
public int getMaxCost(int level) - Overrides:
getMaxCostin classnet.minecraft.world.item.enchantment.Enchantment
-
getMaxLevel
public int getMaxLevel()- Overrides:
getMaxLevelin classnet.minecraft.world.item.enchantment.Enchantment
-
stealLife
public static void stealLife(net.minecraft.world.entity.LivingEntity entity, float damage, int level) Transfer the damage dealt as HP to the attacking entity.- Parameters:
entity- The entity that attacked.damage- The damage that was dealt.level- The level of the enchant.
-