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
,SwiftSneakEnchantment
,ThornsEnchantment
,UnbreakingEnchantment
,VanishingCurseEnchantment
- Mappings:
Namespace Name official ckg
intermediary net/minecraft/class_1887
named net/minecraft/enchantment/Enchantment
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The rarity is an attribute of an enchantment. -
Field Summary
Modifier and TypeFieldDescriptionprivate final Enchantment.Rarity
private final EquipmentSlot[]
final EnchantmentTarget
-
Constructor Summary
ModifierConstructorDescriptionprotected
Enchantment
(Enchantment.Rarity weight, EnchantmentTarget target, EquipmentSlot[] slotTypes) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Enchantment
byRawId
(int id) protected boolean
canAccept
(Enchantment other) Returns whether this enchantment can exist on an item stack with theother
enchantment.final boolean
canCombine
(Enchantment other) Returns whether this enchantment can exist on an item stack with theother
enchantment and theother
enchantment can exist with this enchantment.float
getAttackDamage
(int level, EntityGroup group) getEquipment
(LivingEntity entity) int
int
getMaxPower
(int level) int
int
getMinPower
(int level) getName
(int level) protected String
int
getProtectionAmount
(int level, DamageSource source) boolean
isAcceptableItem
(ItemStack stack) boolean
Returns whether this enchantment will appear in the enchanted book trade offers of librarian villagers.boolean
Returns whether this enchantment will appear in the enchanting table or loots with random enchant function.boolean
isCursed()
boolean
void
onTargetDamaged
(LivingEntity user, Entity target, int level) void
onUserDamaged
(LivingEntity user, Entity attacker, int level)
-
Field Details
-
slotTypes
- Mappings:
Namespace Name Mixin selector official a
Lckg;a:[Lbfo;
intermediary field_9086
Lnet/minecraft/class_1887;field_9086:[Lnet/minecraft/class_1304;
named slotTypes
Lnet/minecraft/enchantment/Enchantment;slotTypes:[Lnet/minecraft/entity/EquipmentSlot;
-
rarity
- Mappings:
Namespace Name Mixin selector official b
Lckg;b:Lckg$a;
intermediary field_9085
Lnet/minecraft/class_1887;field_9085:Lnet/minecraft/class_1887$class_1888;
named rarity
Lnet/minecraft/enchantment/Enchantment;rarity:Lnet/minecraft/enchantment/Enchantment$Rarity;
-
target
- Mappings:
Namespace Name Mixin selector official e
Lckg;e:Lckh;
intermediary field_9083
Lnet/minecraft/class_1887;field_9083:Lnet/minecraft/class_1886;
named target
Lnet/minecraft/enchantment/Enchantment;target:Lnet/minecraft/enchantment/EnchantmentTarget;
-
translationKey
- Mappings:
Namespace Name Mixin selector official f
Lckg;f:Ljava/lang/String;
intermediary field_9084
Lnet/minecraft/class_1887;field_9084:Ljava/lang/String;
named translationKey
Lnet/minecraft/enchantment/Enchantment;translationKey:Ljava/lang/String;
-
-
Constructor Details
-
Enchantment
protected Enchantment(Enchantment.Rarity weight, EnchantmentTarget target, EquipmentSlot[] slotTypes) - Mappings:
Namespace Name Mixin selector official <init>
Lckg;<init>(Lckg$a;Lckh;[Lbfo;)V
intermediary <init>
Lnet/minecraft/class_1887;<init>(Lnet/minecraft/class_1887$class_1888;Lnet/minecraft/class_1886;[Lnet/minecraft/class_1304;)V
named <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 c
Lckg;c(I)Lckg;
intermediary method_8191
Lnet/minecraft/class_1887;method_8191(I)Lnet/minecraft/class_1887;
named byRawId
Lnet/minecraft/enchantment/Enchantment;byRawId(I)Lnet/minecraft/enchantment/Enchantment;
-
getEquipment
- Mappings:
Namespace Name Mixin selector official a
Lckg;a(Lbfz;)Ljava/util/Map;
intermediary method_8185
Lnet/minecraft/class_1887;method_8185(Lnet/minecraft/class_1309;)Ljava/util/Map;
named getEquipment
Lnet/minecraft/enchantment/Enchantment;getEquipment(Lnet/minecraft/entity/LivingEntity;)Ljava/util/Map;
-
getRarity
- Mappings:
Namespace Name Mixin selector official d
Lckg;d()Lckg$a;
intermediary method_8186
Lnet/minecraft/class_1887;method_8186()Lnet/minecraft/class_1887$class_1888;
named getRarity
Lnet/minecraft/enchantment/Enchantment;getRarity()Lnet/minecraft/enchantment/Enchantment$Rarity;
-
getMinLevel
public int getMinLevel()- Mappings:
Namespace Name Mixin selector official e
Lckg;e()I
intermediary method_8187
Lnet/minecraft/class_1887;method_8187()I
named getMinLevel
Lnet/minecraft/enchantment/Enchantment;getMinLevel()I
-
getMaxLevel
public int getMaxLevel()- Mappings:
Namespace Name Mixin selector official a
Lckg;a()I
intermediary method_8183
Lnet/minecraft/class_1887;method_8183()I
named getMaxLevel
Lnet/minecraft/enchantment/Enchantment;getMaxLevel()I
-
getMinPower
public int getMinPower(int level) - Mappings:
Namespace Name Mixin selector official a
Lckg;a(I)I
intermediary method_8182
Lnet/minecraft/class_1887;method_8182(I)I
named getMinPower
Lnet/minecraft/enchantment/Enchantment;getMinPower(I)I
-
getMaxPower
public int getMaxPower(int level) - Mappings:
Namespace Name Mixin selector official b
Lckg;b(I)I
intermediary method_20742
Lnet/minecraft/class_1887;method_20742(I)I
named getMaxPower
Lnet/minecraft/enchantment/Enchantment;getMaxPower(I)I
-
getProtectionAmount
- Mappings:
Namespace Name Mixin selector official a
Lckg;a(ILben;)I
intermediary method_8181
Lnet/minecraft/class_1887;method_8181(ILnet/minecraft/class_1282;)I
named getProtectionAmount
Lnet/minecraft/enchantment/Enchantment;getProtectionAmount(ILnet/minecraft/entity/damage/DamageSource;)I
-
getAttackDamage
- Mappings:
Namespace Name Mixin selector official a
Lckg;a(ILbge;)F
intermediary method_8196
Lnet/minecraft/class_1887;method_8196(ILnet/minecraft/class_1310;)F
named getAttackDamage
Lnet/minecraft/enchantment/Enchantment;getAttackDamage(ILnet/minecraft/entity/EntityGroup;)F
-
canCombine
Returns whether this enchantment can exist on an item stack with theother
enchantment and theother
enchantment can exist with this enchantment.- Returns:
- whether this enchantment can exist on an item stack with the
other
enchantment and theother
enchantment can exist with this enchantment - Mappings:
Namespace Name Mixin selector official b
Lckg;b(Lckg;)Z
intermediary method_8188
Lnet/minecraft/class_1887;method_8188(Lnet/minecraft/class_1887;)Z
named canCombine
Lnet/minecraft/enchantment/Enchantment;canCombine(Lnet/minecraft/enchantment/Enchantment;)Z
-
canAccept
Returns whether this enchantment can exist on an item stack with theother
enchantment.- Returns:
- whether this enchantment can exist on an item stack with the
other
enchantment - Mappings:
Namespace Name Mixin selector official a
Lckg;a(Lckg;)Z
intermediary method_8180
Lnet/minecraft/class_1887;method_8180(Lnet/minecraft/class_1887;)Z
named canAccept
Lnet/minecraft/enchantment/Enchantment;canAccept(Lnet/minecraft/enchantment/Enchantment;)Z
-
getOrCreateTranslationKey
- Mappings:
Namespace Name Mixin selector official f
Lckg;f()Ljava/lang/String;
intermediary method_8190
Lnet/minecraft/class_1887;method_8190()Ljava/lang/String;
named getOrCreateTranslationKey
Lnet/minecraft/enchantment/Enchantment;getOrCreateTranslationKey()Ljava/lang/String;
-
getTranslationKey
- Mappings:
Namespace Name Mixin selector official g
Lckg;g()Ljava/lang/String;
intermediary method_8184
Lnet/minecraft/class_1887;method_8184()Ljava/lang/String;
named getTranslationKey
Lnet/minecraft/enchantment/Enchantment;getTranslationKey()Ljava/lang/String;
-
getName
- Mappings:
Namespace Name Mixin selector official d
Lckg;d(I)Lsw;
intermediary method_8179
Lnet/minecraft/class_1887;method_8179(I)Lnet/minecraft/class_2561;
named getName
Lnet/minecraft/enchantment/Enchantment;getName(I)Lnet/minecraft/text/Text;
-
isAcceptableItem
- Mappings:
Namespace Name Mixin selector official a
Lckg;a(Lcfz;)Z
intermediary method_8192
Lnet/minecraft/class_1887;method_8192(Lnet/minecraft/class_1799;)Z
named isAcceptableItem
Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z
-
onTargetDamaged
- Mappings:
Namespace Name Mixin selector official a
Lckg;a(Lbfz;Lbfj;I)V
intermediary method_8189
Lnet/minecraft/class_1887;method_8189(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)V
named onTargetDamaged
Lnet/minecraft/enchantment/Enchantment;onTargetDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
-
onUserDamaged
- Mappings:
Namespace Name Mixin selector official b
Lckg;b(Lbfz;Lbfj;I)V
intermediary method_8178
Lnet/minecraft/class_1887;method_8178(Lnet/minecraft/class_1309;Lnet/minecraft/class_1297;I)V
named onUserDamaged
Lnet/minecraft/enchantment/Enchantment;onUserDamaged(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/Entity;I)V
-
isTreasure
public boolean isTreasure()- Mappings:
Namespace Name Mixin selector official b
Lckg;b()Z
intermediary method_8193
Lnet/minecraft/class_1887;method_8193()Z
named isTreasure
Lnet/minecraft/enchantment/Enchantment;isTreasure()Z
-
isCursed
public boolean isCursed()- Mappings:
Namespace Name Mixin selector official c
Lckg;c()Z
intermediary method_8195
Lnet/minecraft/class_1887;method_8195()Z
named isCursed
Lnet/minecraft/enchantment/Enchantment;isCursed()Z
-
isAvailableForEnchantedBookOffer
public boolean isAvailableForEnchantedBookOffer()Returns whether this enchantment will appear in the enchanted book trade offers of librarian villagers.- Returns:
- whether this enchantment will appear in the enchanted book trade offers of librarian villagers
- Mappings:
Namespace Name Mixin selector official h
Lckg;h()Z
intermediary method_25949
Lnet/minecraft/class_1887;method_25949()Z
named isAvailableForEnchantedBookOffer
Lnet/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.- Returns:
- whether this enchantment will appear in the enchanting table or loots with random enchant function
- Mappings:
Namespace Name Mixin selector official i
Lckg;i()Z
intermediary method_25950
Lnet/minecraft/class_1887;method_25950()Z
named isAvailableForRandomSelection
Lnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z
-