Package net.minecraft.enchantment
Class ProtectionEnchantment
java.lang.Object
net.minecraft.enchantment.Enchantment
net.minecraft.enchantment.ProtectionEnchantment
public class ProtectionEnchantment extends Enchantment
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProtectionEnchantment.Type
Nested classes/interfaces inherited from class net.minecraft.enchantment.Enchantment
Enchantment.Rarity
-
Field Summary
Fields Modifier and Type Field Description ProtectionEnchantment.Type
protectionType
Fields inherited from class net.minecraft.enchantment.Enchantment
translationKey, type
-
Constructor Summary
Constructors Constructor Description ProtectionEnchantment(Enchantment.Rarity weight, ProtectionEnchantment.Type type, EquipmentSlot[] equipmentSlot)
-
Method Summary
Modifier and Type Method Description boolean
canAccept(Enchantment other)
Returns whether this enchantment can exist on an item stack with theother
enchantment.int
getMaxLevel()
int
getMaxPower(int level)
int
getMinPower(int level)
int
getProtectionAmount(int level, DamageSource source)
static double
transformExplosionKnockback(LivingEntity entity, double velocity)
static int
transformFireDuration(LivingEntity entity, int duration)
Methods inherited from class net.minecraft.enchantment.Enchantment
byRawId, canCombine, getAttackDamage, getEquipment, getMinLevel, getName, getOrCreateTranslationKey, getRarity, getTranslationKey, isAcceptableItem, isAvailableForEnchantedBookOffer, isAvailableForRandomSelection, isCursed, isTreasure, onTargetDamaged, onUserDamaged
-
Field Details
-
protectionType
-
-
Constructor Details
-
ProtectionEnchantment
public ProtectionEnchantment(Enchantment.Rarity weight, ProtectionEnchantment.Type type, EquipmentSlot[] equipmentSlot)
-
-
Method Details
-
getMinPower
public int getMinPower(int level)- Overrides:
getMinPower
in classEnchantment
-
getMaxPower
public int getMaxPower(int level)- Overrides:
getMaxPower
in classEnchantment
-
getMaxLevel
public int getMaxLevel()- Overrides:
getMaxLevel
in classEnchantment
-
getProtectionAmount
- Overrides:
getProtectionAmount
in classEnchantment
-
canAccept
Returns whether this enchantment can exist on an item stack with theother
enchantment.- Overrides:
canAccept
in classEnchantment
-
transformFireDuration
-
transformExplosionKnockback
-