Package net.minecraft.enchantment
Record Class EnchantmentEffectContext
java.lang.Object
java.lang.Record
net.minecraft.enchantment.EnchantmentEffectContext
- Record Components:
stack
-slot
-owner
-onBreak
-
public record EnchantmentEffectContext(ItemStack stack, @Nullable EquipmentSlot slot, @Nullable LivingEntity owner, Consumer<Item> onBreak)
extends Record
- Mappings:
Namespace Name named net/minecraft/enchantment/EnchantmentEffectContext
intermediary net/minecraft/class_9699
official czl
named stack
intermediary comp_2682
official a
named slot
intermediary comp_2683
official b
named owner
intermediary comp_2684
official c
named onBreak
intermediary comp_2685
official d
-
Field Summary
Modifier and TypeFieldDescriptionThe field for theonBreak
record component.private final @Nullable LivingEntity
The field for theowner
record component.private final @Nullable EquipmentSlot
The field for theslot
record component.private final ItemStack
The field for thestack
record component. -
Constructor Summary
ConstructorDescriptionEnchantmentEffectContext
(ItemStack itemStack, @Nullable EquipmentSlot equipmentSlot, @Nullable LivingEntity livingEntity, Consumer<Item> consumer) EnchantmentEffectContext
(ItemStack stack, EquipmentSlot slot, LivingEntity owner) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.onBreak()
Returns the value of theonBreak
record component.owner()
Returns the value of theowner
record component.slot()
Returns the value of theslot
record component.stack()
Returns the value of thestack
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
Constructor Details
-
EnchantmentEffectContext
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/enchantment/EnchantmentEffectContext;<init>(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/EquipmentSlot;Lnet/minecraft/entity/LivingEntity;)V
intermediary <init>
Lnet/minecraft/class_9699;<init>(Lnet/minecraft/class_1799;Lnet/minecraft/class_1304;Lnet/minecraft/class_1309;)V
official <init>
Lczl;<init>(Lcud;Lbso;Lbtc;)V
-
EnchantmentEffectContext
public EnchantmentEffectContext(ItemStack itemStack, @Nullable @Nullable EquipmentSlot equipmentSlot, @Nullable @Nullable LivingEntity livingEntity, Consumer<Item> consumer)
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
stack
Returns the value of thestack
record component.- Returns:
- the value of the
stack
record component
-
slot
Returns the value of theslot
record component.- Returns:
- the value of the
slot
record component
-
owner
Returns the value of theowner
record component.- Returns:
- the value of the
owner
record component
-
onBreak
Returns the value of theonBreak
record component.- Returns:
- the value of the
onBreak
record component
-