Record Class ExperienceYieldEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.ExperienceYieldEffect
- Record Components:
multiplier- TheLevelBasedValuefactor by which generated experience is multiplied.
public record ExperienceYieldEffect(net.minecraft.world.item.enchantment.LevelBasedValue multiplier)
extends Record
Data-driven enchantment effect component that multiplies the experience orbs dropped from breaking
blocks (including auto-smelted block drops) and killing living entities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ExperienceYieldEffect> Codec for serializing and deserializingExperienceYieldEffectinstances from JSON.static final StringRegistry path identifier for this effect component.static final LevelBasedKeyProviderSupplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation.static final StringJSON field key for the experience yield multiplier. -
Constructor Summary
ConstructorsConstructorDescriptionExperienceYieldEffect(net.minecraft.world.item.enchantment.LevelBasedValue multiplier) Creates an instance of aExperienceYieldEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.enchantment.LevelBasedValueReturns the value of themultiplierrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MULTIPLIER
JSON field key for the experience yield multiplier.- See Also:
-
KEY
Registry path identifier for this effect component.- See Also:
-
KEY_PROVIDER
Supplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
CODEC
Codec for serializing and deserializingExperienceYieldEffectinstances from JSON.
-
-
Constructor Details
-
ExperienceYieldEffect
public ExperienceYieldEffect(net.minecraft.world.item.enchantment.LevelBasedValue multiplier) Creates an instance of aExperienceYieldEffectrecord class.- Parameters:
multiplier- the value for themultiplierrecord component
-
-
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). -
multiplier
public net.minecraft.world.item.enchantment.LevelBasedValue multiplier()Returns the value of themultiplierrecord component.- Returns:
- the value of the
multiplierrecord component
-