记录类 EnchantmentAttributeEffect
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.EnchantmentAttributeEffect
- 所有已实现的接口:
EnchantmentLocationBasedEffect
public record EnchantmentAttributeEffect(ResourceLocation id, Holder<Attribute> attribute, LevelBasedValue amount, AttributeModifier.Operation operation)
extends Record
implements EnchantmentLocationBasedEffect
-
字段概要
字段修饰符和类型字段说明private final LevelBasedValue
amount
记录组件的字段。attribute
记录组件的字段。static final com.mojang.serialization.MapCodec
<EnchantmentAttributeEffect> private final ResourceLocation
id
记录组件的字段。private final AttributeModifier.Operation
operation
记录组件的字段。 -
构造器概要
构造器构造器说明EnchantmentAttributeEffect
(ResourceLocation id, Holder<Attribute> attribute, LevelBasedValue amount, AttributeModifier.Operation operation) 创建EnchantmentAttributeEffect
记录类的实例。 -
方法概要
修饰符和类型方法说明amount()
返回amount
记录组件的值。返回attribute
记录组件的值。com.mojang.serialization.MapCodec
<EnchantmentAttributeEffect> codec()
final boolean
指示某个其他对象是否“等于”此对象。getModifier
(int p_345225_, StringRepresentable p_350734_) final int
hashCode()
返回此对象的哈希代码值。id()
返回id
记录组件的值。private ResourceLocation
idForSlot
(StringRepresentable p_350940_) private com.google.common.collect.HashMultimap
<Holder<Attribute>, AttributeModifier> makeAttributeMap
(int p_346033_, EquipmentSlot p_350290_) void
onChangedBlock
(ServerLevel p_346176_, int p_345071_, EnchantedItemInUse p_345394_, Entity p_345539_, Vec3 p_346261_, boolean p_345801_) void
onDeactivated
(EnchantedItemInUse p_346016_, Entity p_346371_, Vec3 p_345145_, int p_346185_) 返回operation
记录组件的值。final String
toString()
返回此记录类的字符串表示形式。
-
字段详细资料
-
id
id
记录组件的字段。 -
attribute
attribute
记录组件的字段。 -
amount
amount
记录组件的字段。 -
operation
operation
记录组件的字段。 -
CODEC
-
-
构造器详细资料
-
EnchantmentAttributeEffect
public EnchantmentAttributeEffect(ResourceLocation id, Holder<Attribute> attribute, LevelBasedValue amount, AttributeModifier.Operation operation) 创建EnchantmentAttributeEffect
记录类的实例。- 参数:
id
-id
记录组件的值attribute
-attribute
记录组件的值amount
-amount
记录组件的值operation
-operation
记录组件的值
-
-
方法详细资料
-
idForSlot
-
getModifier
-
onChangedBlock
public void onChangedBlock(ServerLevel p_346176_, int p_345071_, EnchantedItemInUse p_345394_, Entity p_345539_, Vec3 p_346261_, boolean p_345801_) - 指定者:
onChangedBlock
在接口中EnchantmentLocationBasedEffect
-
onDeactivated
public void onDeactivated(EnchantedItemInUse p_346016_, Entity p_346371_, Vec3 p_345145_, int p_346185_) - 指定者:
onDeactivated
在接口中EnchantmentLocationBasedEffect
-
makeAttributeMap
private com.google.common.collect.HashMultimap<Holder<Attribute>,AttributeModifier> makeAttributeMap(int p_346033_, EquipmentSlot p_350290_) -
codec
- 指定者:
codec
在接口中EnchantmentLocationBasedEffect
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用Objects::equals(Object,Object)
进行比较。 -
id
返回id
记录组件的值。- 返回:
id
记录组件的值
-
attribute
返回attribute
记录组件的值。- 返回:
attribute
记录组件的值
-
amount
返回amount
记录组件的值。- 返回:
amount
记录组件的值
-
operation
返回operation
记录组件的值。- 返回:
operation
记录组件的值
-