Package net.minecraft.enchantment
Class Enchantment
java.lang.Object
net.minecraft.enchantment.Enchantment
- Direct Known Subclasses:
BindingCurseEnchantment
,DamageEnchantment
,DepthStriderEnchantment
,FrostWalkerEnchantment
,InfinityEnchantment
,LuckEnchantment
,MendingEnchantment
,MultishotEnchantment
,PiercingEnchantment
,ProtectionEnchantment
,RiptideEnchantment
,SilkTouchEnchantment
,SoulSpeedEnchantment
,SwiftSneakEnchantment
,ThornsEnchantment
,UnbreakingEnchantment
,VanishingCurseEnchantment
- Mappings:
Namespace Name official cyg
intermediary net/minecraft/class_1887
named net/minecraft/enchantment/Enchantment
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Enchantment.class_9427
private final RegistryEntry.Reference
<Enchantment> -
Constructor Summary
Constructors -
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, @Nullable EntityType<?> entityType) getEquipment
(LivingEntity entity) final int
final int
getMaxPower
(int level) final int
final int
getMinPower
(int level) getName
(int level) protected String
int
getProtectionAmount
(int level, DamageSource source) Deprecated.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
static Enchantment.class_9426
method_58440
(int int2) static Enchantment.class_9426
method_58441
(int int2, int int3) static Enchantment.class_9427
method_58442
(TagKey<Item> tagKey, int int2, int int3, Enchantment.class_9426 class_9426, Enchantment.class_9426 class_94262, int int4, EquipmentSlot[] equipmentSlot) static Enchantment.class_9427
method_58443
(TagKey<Item> tagKey, TagKey<Item> tagKey2, int int2, int int3, Enchantment.class_9426 class_9426, Enchantment.class_9426 class_94262, int int4, EquipmentSlot[] equipmentSlot) final boolean
method_58444
(ItemStack itemStack) final int
final int
void
onTargetDamaged
(LivingEntity user, Entity target, int level) void
onUserDamaged
(LivingEntity user, Entity attacker, int level)
-
Field Details
-
field_50013
- Mappings:
Namespace Name Mixin selector official b
Lcyg;b:Lcyg$b;
intermediary field_50013
Lnet/minecraft/class_1887;field_50013:Lnet/minecraft/class_1887$class_9427;
named field_50013
Lnet/minecraft/enchantment/Enchantment;field_50013:Lnet/minecraft/enchantment/Enchantment$class_9427;
-
translationKey
- Mappings:
Namespace Name Mixin selector official a
Lcyg;a: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;
-
registryEntry
- Mappings:
Namespace Name Mixin selector official c
Lcyg;c:Liw$c;
intermediary field_45769
Lnet/minecraft/class_1887;field_45769:Lnet/minecraft/class_6880$class_6883;
named registryEntry
Lnet/minecraft/enchantment/Enchantment;registryEntry:Lnet/minecraft/registry/entry/RegistryEntry$Reference;
-
-
Constructor Details
-
Enchantment
-
-
Method Details
-
method_58440
- Mappings:
Namespace Name Mixin selector official a
Lcyg;a(I)Lcyg$a;
intermediary method_58440
Lnet/minecraft/class_1887;method_58440(I)Lnet/minecraft/class_1887$class_9426;
named method_58440
Lnet/minecraft/enchantment/Enchantment;method_58440(I)Lnet/minecraft/enchantment/Enchantment$class_9426;
-
method_58441
- Mappings:
Namespace Name Mixin selector official a
Lcyg;a(II)Lcyg$a;
intermediary method_58441
Lnet/minecraft/class_1887;method_58441(II)Lnet/minecraft/class_1887$class_9426;
named method_58441
Lnet/minecraft/enchantment/Enchantment;method_58441(II)Lnet/minecraft/enchantment/Enchantment$class_9426;
-
method_58443
public static Enchantment.class_9427 method_58443(TagKey<Item> tagKey, TagKey<Item> tagKey2, int int2, int int3, Enchantment.class_9426 class_9426, Enchantment.class_9426 class_94262, int int4, EquipmentSlot[] equipmentSlot) - Mappings:
Namespace Name Mixin selector official a
Lcyg;a(Lawg;Lawg;IILcyg$a;Lcyg$a;I[Lbro;)Lcyg$b;
intermediary method_58443
Lnet/minecraft/class_1887;method_58443(Lnet/minecraft/class_6862;Lnet/minecraft/class_6862;IILnet/minecraft/class_1887$class_9426;Lnet/minecraft/class_1887$class_9426;I[Lnet/minecraft/class_1304;)Lnet/minecraft/class_1887$class_9427;
named method_58443
Lnet/minecraft/enchantment/Enchantment;method_58443(Lnet/minecraft/registry/tag/TagKey;Lnet/minecraft/registry/tag/TagKey;IILnet/minecraft/enchantment/Enchantment$class_9426;Lnet/minecraft/enchantment/Enchantment$class_9426;I[Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/enchantment/Enchantment$class_9427;
-
method_58442
public static Enchantment.class_9427 method_58442(TagKey<Item> tagKey, int int2, int int3, Enchantment.class_9426 class_9426, Enchantment.class_9426 class_94262, int int4, EquipmentSlot[] equipmentSlot) - Mappings:
Namespace Name Mixin selector official a
Lcyg;a(Lawg;IILcyg$a;Lcyg$a;I[Lbro;)Lcyg$b;
intermediary method_58442
Lnet/minecraft/class_1887;method_58442(Lnet/minecraft/class_6862;IILnet/minecraft/class_1887$class_9426;Lnet/minecraft/class_1887$class_9426;I[Lnet/minecraft/class_1304;)Lnet/minecraft/class_1887$class_9427;
named method_58442
Lnet/minecraft/enchantment/Enchantment;method_58442(Lnet/minecraft/registry/tag/TagKey;IILnet/minecraft/enchantment/Enchantment$class_9426;Lnet/minecraft/enchantment/Enchantment$class_9426;I[Lnet/minecraft/entity/EquipmentSlot;)Lnet/minecraft/enchantment/Enchantment$class_9427;
-
byRawId
- Mappings:
Namespace Name Mixin selector official b
Lcyg;b(I)Lcyg;
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
Lcyg;a(Lbsa;)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;
-
getApplicableItems
- Mappings:
Namespace Name Mixin selector official c
Lcyg;c()Lawg;
intermediary method_56109
Lnet/minecraft/class_1887;method_56109()Lnet/minecraft/class_6862;
named getApplicableItems
Lnet/minecraft/enchantment/Enchantment;getApplicableItems()Lnet/minecraft/registry/tag/TagKey;
-
method_58444
- Mappings:
Namespace Name Mixin selector official a
Lcyg;a(Lcsz;)Z
intermediary method_58444
Lnet/minecraft/class_1887;method_58444(Lnet/minecraft/class_1799;)Z
named method_58444
Lnet/minecraft/enchantment/Enchantment;method_58444(Lnet/minecraft/item/ItemStack;)Z
-
method_58445
public final int method_58445()- Mappings:
Namespace Name Mixin selector official d
Lcyg;d()I
intermediary method_58445
Lnet/minecraft/class_1887;method_58445()I
named method_58445
Lnet/minecraft/enchantment/Enchantment;method_58445()I
-
method_58446
public final int method_58446()- Mappings:
Namespace Name Mixin selector official e
Lcyg;e()I
intermediary method_58446
Lnet/minecraft/class_1887;method_58446()I
named method_58446
Lnet/minecraft/enchantment/Enchantment;method_58446()I
-
getMinLevel
public final int getMinLevel()- Mappings:
Namespace Name Mixin selector official f
Lcyg;f()I
intermediary method_8187
Lnet/minecraft/class_1887;method_8187()I
named getMinLevel
Lnet/minecraft/enchantment/Enchantment;getMinLevel()I
-
getMaxLevel
public final int getMaxLevel()- Mappings:
Namespace Name Mixin selector official g
Lcyg;g()I
intermediary method_8183
Lnet/minecraft/class_1887;method_8183()I
named getMaxLevel
Lnet/minecraft/enchantment/Enchantment;getMaxLevel()I
-
getMinPower
public final int getMinPower(int level) - Mappings:
Namespace Name Mixin selector official c
Lcyg;c(I)I
intermediary method_8182
Lnet/minecraft/class_1887;method_8182(I)I
named getMinPower
Lnet/minecraft/enchantment/Enchantment;getMinPower(I)I
-
getMaxPower
public final int getMaxPower(int level) - Mappings:
Namespace Name Mixin selector official d
Lcyg;d(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
Lcyg;a(ILbqf;)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
Lcyg;a(ILbrn;)F
intermediary method_8196
Lnet/minecraft/class_1887;method_8196(ILnet/minecraft/class_1299;)F
named getAttackDamage
Lnet/minecraft/enchantment/Enchantment;getAttackDamage(ILnet/minecraft/entity/EntityType;)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
Lcyg;b(Lcyg;)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
Lcyg;a(Lcyg;)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 h
Lcyg;h()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 i
Lcyg;i()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 e
Lcyg;e(I)Lwu;
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 b
Lcyg;b(Lcsz;)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
Lcyg;a(Lbsa;Lbrh;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
Lcyg;b(Lbsa;Lbrh;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 a
Lcyg;a()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 b
Lcyg;b()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 j
Lcyg;j()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 k
Lcyg;k()Z
intermediary method_25950
Lnet/minecraft/class_1887;method_25950()Z
named isAvailableForRandomSelection
Lnet/minecraft/enchantment/Enchantment;isAvailableForRandomSelection()Z
-
getRegistryEntry
Deprecated.- Mappings:
Namespace Name Mixin selector official l
Lcyg;l()Liw$c;
intermediary method_53216
Lnet/minecraft/class_1887;method_53216()Lnet/minecraft/class_6880$class_6883;
named getRegistryEntry
Lnet/minecraft/enchantment/Enchantment;getRegistryEntry()Lnet/minecraft/registry/entry/RegistryEntry$Reference;
-