Package net.minecraft.enchantment
Class Enchantment
java.lang.Object
net.minecraft.enchantment.Enchantment
- Direct Known Subclasses:
AquaAffinityEnchantment,BindingCurseEnchantment,ChannelingEnchantment,DamageEnchantment,DepthStriderEnchantment,EfficiencyEnchantment,FireAspectEnchantment,FlameEnchantment,FrostWalkerEnchantment,ImpalingEnchantment,InfinityEnchantment,KnockbackEnchantment,LoyaltyEnchantment,LuckEnchantment,LureEnchantment,MendingEnchantment,MultishotEnchantment,PiercingEnchantment,PowerEnchantment,ProtectionEnchantment,PunchEnchantment,QuickChargeEnchantment,RespirationEnchantment,RiptideEnchantment,SilkTouchEnchantment,SoulSpeedEnchantment,SweepingEnchantment,ThornsEnchantment,UnbreakingEnchantment,VanishingCurseEnchantment
public abstract class Enchantment extends Object
- Mappings:
Namespace Name official bskintermediary net/minecraft/class_1887named net/minecraft/enchantment/Enchantment
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEnchantment.RarityThe rarity is an attribute of an enchantment. -
Field Summary
Fields Modifier and Type Field Description private Enchantment.Rarityrarityprivate EquipmentSlot[]slotTypesprotected @Nullable StringtranslationKeyEnchantmentTargettype -
Constructor Summary
Constructors Modifier Constructor Description protectedEnchantment(Enchantment.Rarity weight, EnchantmentTarget type, EquipmentSlot[] slotTypes) -
Method Summary
Modifier and Type Method Description static @Nullable EnchantmentbyRawId(int id)protected booleancanAccept(Enchantment other)Returns whether this enchantment can exist on an item stack with theotherenchantment.booleancanCombine(Enchantment other)Returns whether this enchantment can exist on an item stack with theotherenchantment and theotherenchantment can exist with this enchantment.floatgetAttackDamage(int level, EntityGroup group)Map<EquipmentSlot,ItemStack>getEquipment(LivingEntity entity)intgetMaxLevel()intgetMaxPower(int level)intgetMinLevel()intgetMinPower(int level)TextgetName(int level)protected StringgetOrCreateTranslationKey()intgetProtectionAmount(int level, DamageSource source)Enchantment.RaritygetRarity()StringgetTranslationKey()booleanisAcceptableItem(ItemStack stack)booleanisAvailableForEnchantedBookOffer()Returns whether this enchantment will appear in the enchanted book trade offers of librarian villagers.booleanisAvailableForRandomSelection()Returns whether this enchantment will appear in the enchanting table or loots with random enchant function.booleanisCursed()booleanisTreasure()voidonTargetDamaged(LivingEntity user, Entity target, int level)voidonUserDamaged(LivingEntity user, Entity attacker, int level)
-
Field Details
-
slotTypes
- Mappings:
Namespace Name Mixin selector official aLbsk;a:[Lart;intermediary field_9086Lnet/minecraft/class_1887;field_9086:[Lnet/minecraft/class_1304;named slotTypesLnet/minecraft/enchantment/Enchantment;slotTypes:[Lnet/minecraft/entity/EquipmentSlot;
-
rarity
- Mappings:
Namespace Name Mixin selector official dLbsk;d:Lbsk$a;intermediary field_9085Lnet/minecraft/class_1887;field_9085:Lnet/minecraft/class_1887$class_1888;named rarityLnet/minecraft/enchantment/Enchantment;rarity:Lnet/minecraft/enchantment/Enchantment$Rarity;
-
type
- Mappings:
Namespace Name Mixin selector official bLbsk;b:Lbsl;intermediary field_9083Lnet/minecraft/class_1887;field_9083:Lnet/minecraft/class_1886;named typeLnet/minecraft/enchantment/Enchantment;type:Lnet/minecraft/enchantment/EnchantmentTarget;
-
translationKey
- Mappings:
Namespace Name Mixin selector official cLbsk;c:Ljava/lang/String;intermediary field_9084Lnet/minecraft/class_1887;field_9084:Ljava/lang/String;named translationKeyLnet/minecraft/enchantment/Enchantment;translationKey:Ljava/lang/String;
-
-
Constructor Details
-
Enchantment
protected Enchantment(Enchantment.Rarity weight, EnchantmentTarget type, EquipmentSlot[] slotTypes)- Mappings:
Namespace Name Mixin selector official <init>Lbsk;<init>(Lbsk$a;Lbsl;[Lart;)Vintermediary <init>Lnet/minecraft/class_1887;<init>(Lnet/minecraft/class_1887$class_1888;Lnet/minecraft/class_1886;[Lnet/minecraft/class_1304;)Vnamed <init>Lnet/minecraft/enchantment/Enchantment;<init>(Lnet/minecraft/enchantment/Enchantment$Rarity;Lnet/minecraft/enchantment/EnchantmentTarget;[Lnet/minecraft/entity/EquipmentSlot;)V
-
-
Method Details
-
byRawId
- Mappings:
Namespace Name Mixin selector official cLbsk;c(I)Lbsk;intermediary method_8191Lnet/minecraft/class_1887;method_8191(I)Lnet/minecraft/class_1887;named byRawIdLnet/minecraft/enchantment/Enchantment;byRawId(I)Lnet/minecraft/enchantment/Enchantment;
-
getEquipment
- Mappings:
Namespace Name Mixin selector official aLbsk;a(Lasb;)Ljava/util/Map;intermediary method_8185Lnet/minecraft/class_1887;method_8185(Lnet/minecraft/class_1309;)Ljava/util/Map;named getEquipmentLnet/minecraft/enchantment/Enchantment;getEquipment(Lnet/minecraft/entity/LivingEntity;)Ljava/util/Map;
-
getRarity
- Mappings:
Namespace Name Mixin selector official dLbsk;d()Lbsk$a;intermediary method_8186Lnet/minecraft/class_1887;method_8186()Lnet/minecraft/class_1887$class_1888;named getRarityLnet/minecraft/enchantment/Enchantment;getRarity()Lnet/minecraft/enchantment/Enchantment$Rarity;
-
getMinLevel
public int getMinLevel()- Mappings:
Namespace Name Mixin selector official eLbsk;e()Iintermediary method_8187Lnet/minecraft/class_1887;method_8187()Inamed getMinLevelLnet/minecraft/enchantment/Enchantment;getMinLevel()I
-
getMaxLevel
public int getMaxLevel()- Mappings:
Namespace Name Mixin selector official aLbsk;a()Iintermediary method_8183Lnet/minecraft/class_1887;method_8183()Inamed getMaxLevelLnet/minecraft/enchantment/Enchantment;getMaxLevel()I
-
getMinPower
public int getMinPower(int level)- Mappings:
Namespace Name Mixin selector official aLbsk;a(I)Iintermediary method_8182Lnet/minecraft/class_1887;method_8182(I)Inamed getMinPowerLnet/minecraft/enchantment/Enchantment;getMinPower(I)I
-
getMaxPower
public int getMaxPower(int level)- Mappings:
Namespace Name Mixin selector official bLbsk;b(I)Iintermediary method_20742Lnet/minecraft/class_1887;method_20742(I)Inamed getMaxPowerLnet/minecraft/enchantment/Enchantment;getMaxPower(I)I
-
getProtectionAmount
- Mappings:
Namespace Name Mixin selector official aLbsk;a(ILaqy;)Iintermediary method_8181Lnet/minecraft/class_1887;method_8181(ILnet/minecraft/class_1282;)Inamed getProtectionAmountLnet/minecraft/enchantment/Enchantment;getProtectionAmount(ILnet/minecraft/entity/damage/DamageSource;)I
-
getAttackDamage
- Mappings:
Namespace Name Mixin selector official aLbsk;a(ILasf;)Fintermediary method_8196Lnet/minecraft/class_1887;method_8196(ILnet/minecraft/class_1310;)Fnamed getAttackDamageLnet/minecraft/enchantment/Enchantment;getAttackDamage(ILnet/minecraft/entity/EntityGroup;)F
-
canCombine
Returns whether this enchantment can exist on an item stack with theotherenchantment and theotherenchantment can exist with this enchantment.- Mappings:
Namespace Name Mixin selector official bLbsk;b(Lbsk;)Zintermediary method_8188Lnet/minecraft/class_1887;method_8188(Lnet/minecraft/class_1887;)Znamed canCombineLnet/minecraft/enchantment/Enchantment;canCombine(Lnet/minecraft/enchantment/Enchantment;)Z
-
canAccept
Returns whether this enchantment can exist on an item stack with theotherenchantment.- Mappings:
Namespace Name Mixin selector official aLbsk;a(Lbsk;)Zintermediary method_8180Lnet/minecraft/class_1887;method_8180(Lnet/minecraft/class_1887;)Znamed canAcceptLnet/minecraft/enchantment/Enchantment;canAccept(Lnet/minecraft/enchantment/Enchantment;)Z
-
getOrCreateTranslationKey
- Mappings:
Namespace Name Mixin selector official fLbsk;f()Ljava/lang/String;intermediary method_8190Lnet/minecraft/class_1887;method_8190()Ljava/lang/String;named getOrCreateTranslationKeyLnet/minecraft/enchantment/Enchantment;getOrCreateTranslationKey()Ljava/lang/String;
-
getTranslationKey
- Mappings:
Namespace Name Mixin selector official gLbsk;g()Ljava/lang/String;intermediary method_8184Lnet/minecraft/class_1887;method_8184()Ljava/lang/String;named getTranslationKeyLnet/minecraft/enchantment/Enchantment;getTranslationKey()Ljava/lang/String;
-
getName
- Mappings:
Namespace Name Mixin selector official dLbsk;d(I)Loj;intermediary method_8179Lnet/minecraft/class_1887;method_8179(I)Lnet/minecraft/class_2561;named getNameLnet/minecraft/enchantment/Enchantment;getName(I)Lnet/minecraft/text/Text;
-
isAcceptableItem
- Mappings:
Namespace Name Mixin selector official aLbsk;a(Lboq;)Zintermediary method_8192Lnet/minecraft/class_1887;method_8192(Lnet/minecraft/class_1799;)Znamed isAcceptableItemLnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z
-
onTargetDamaged
- Mappings:
Namespace Name Mixin selector official aLbsk;a(Lasb;Laro;I)Vintermediary method_8189Lnet/minecraft/class_1887;method_8189(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)Vnamed onTargetDamagedLnet/minecraft/enchantment/Enchantment;onTargetDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
-
onUserDamaged
- Mappings:
Namespace Name Mixin selector official bLbsk;b(Lasb;Laro;I)Vintermediary method_8178Lnet/minecraft/class_1887;method_8178(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)Vnamed onUserDamagedLnet/minecraft/enchantment/Enchantment;onUserDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
-
isTreasure
public boolean isTreasure()- Mappings:
Namespace Name Mixin selector official bLbsk;b()Zintermediary method_8193Lnet/minecraft/class_1887;method_8193()Znamed isTreasureLnet/minecraft/enchantment/Enchantment;isTreasure()Z
-
isCursed
public boolean isCursed()- Mappings:
Namespace Name Mixin selector official cLbsk;c()Zintermediary method_8195Lnet/minecraft/class_1887;method_8195()Znamed isCursedLnet/minecraft/enchantment/Enchantment;isCursed()Z
-
isAvailableForEnchantedBookOffer
public boolean isAvailableForEnchantedBookOffer()Returns whether this enchantment will appear in the enchanted book trade offers of librarian villagers.- Mappings:
Namespace Name Mixin selector official hLbsk;h()Zintermediary method_25949Lnet/minecraft/class_1887;method_25949()Znamed isAvailableForEnchantedBookOfferLnet/minecraft/enchantment/Enchantment;isAvailableForEnchantedBookOffer()Z
-
isAvailableForRandomSelection
public boolean isAvailableForRandomSelection()Returns whether this enchantment will appear in the enchanting table or loots with random enchant function.- Mappings:
Namespace Name Mixin selector official iLbsk;i()Zintermediary method_25950Lnet/minecraft/class_1887;method_25950()Znamed isAvailableForRandomSelectionLnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z
-