Record Class BuoyancyEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.BuoyancyEffect
- Record Components:
breakSpeedMultiplier- TheLevelBasedValuemultiplier applied to the player's block breaking speed while submerged and ungrounded.
public record BuoyancyEffect(net.minecraft.world.item.enchantment.LevelBasedValue breakSpeedMultiplier)
extends Record
Data-driven enchantment effect component that prevents an entity from passively sinking while
submerged in water or lava, and optionally scales block mining speed while floating in fluids.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJSON field key for the submerged mining speed multiplier.static final com.mojang.serialization.Codec<BuoyancyEffect> Codec for serializing and deserializingBuoyancyEffectinstances from JSON.static final StringRegistry path identifier for this effect component.static final LevelBasedKeyProviderSupplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
Constructor Summary
ConstructorsConstructorDescriptionBuoyancyEffect(net.minecraft.world.item.enchantment.LevelBasedValue breakSpeedMultiplier) Creates an instance of aBuoyancyEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.enchantment.LevelBasedValueReturns the value of thebreakSpeedMultiplierrecord 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
-
BREAK_SPEED_MULTIPLIER
JSON field key for the submerged mining speed multiplier.- See Also:
-
KEY
-
KEY_PROVIDER
Supplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
CODEC
Codec for serializing and deserializingBuoyancyEffectinstances from JSON.
-
-
Constructor Details
-
BuoyancyEffect
public BuoyancyEffect(net.minecraft.world.item.enchantment.LevelBasedValue breakSpeedMultiplier) Creates an instance of aBuoyancyEffectrecord class.- Parameters:
breakSpeedMultiplier- the value for thebreakSpeedMultiplierrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
breakSpeedMultiplier
public net.minecraft.world.item.enchantment.LevelBasedValue breakSpeedMultiplier()Returns the value of thebreakSpeedMultiplierrecord component.- Returns:
- the value of the
breakSpeedMultiplierrecord component
-