Record Class BowChargeTimeEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.BowChargeTimeEffect
- Record Components:
amount- ALevelBasedValuecalculating the change in full-charge duration in seconds (negative values reduce draw time).
public record BowChargeTimeEffect(net.minecraft.world.item.enchantment.LevelBasedValue amount)
extends Record
Data-driven enchantment effect component that modifies the draw time required for a
BowItem
to reach full power.
Applied on both the server (via BowItemMixin during arrow release) and the client (via
ItemPropertiesMixin for pull animation synchronization).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJSON field key for the charge time modification in seconds.static final com.mojang.serialization.Codec<BowChargeTimeEffect> Codec for serializing and deserializingBowChargeTimeEffectinstances from JSON.static final StringRegistry path identifier for this effect component.static final LevelBasedKeyProviderSupplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
Constructor Summary
ConstructorsConstructorDescriptionBowChargeTimeEffect(net.minecraft.world.item.enchantment.LevelBasedValue amount) Creates an instance of aBowChargeTimeEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.enchantment.LevelBasedValueamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
AMOUNT
JSON field key for the charge time modification in seconds.- 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 deserializingBowChargeTimeEffectinstances from JSON.
-
-
Constructor Details
-
BowChargeTimeEffect
public BowChargeTimeEffect(net.minecraft.world.item.enchantment.LevelBasedValue amount) Creates an instance of aBowChargeTimeEffectrecord class.- Parameters:
amount- the value for theamountrecord 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). -
amount
public net.minecraft.world.item.enchantment.LevelBasedValue amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-