Record Class FluidWalkerEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.FluidWalkerEffect
- Record Components:
allowedFluids- TheHolderSetof fluids treated as solid surfaces when approached from above.speedRetention- TheLevelBasedValuemovement speed multiplier while walking on matching fluids.
- All Implemented Interfaces:
FluidWalkerDefinition
public record FluidWalkerEffect(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids, net.minecraft.world.item.enchantment.LevelBasedValue speedRetention)
extends Record
implements FluidWalkerDefinition
Standard record implementation of
FluidWalkerDefinition enabling entities to stand and walk
atop specified fluid blocks without modifying world block states.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJSON field key for the set of walkable fluids.static final com.mojang.serialization.Codec<FluidWalkerEffect> Codec for serializing and deserializingFluidWalkerEffectinstances 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 surface movement speed multiplier. -
Constructor Summary
ConstructorsConstructorDescriptionFluidWalkerEffect(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids, net.minecraft.world.item.enchantment.LevelBasedValue speedRetention) Creates an instance of aFluidWalkerEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> Returns the value of theallowedFluidsrecord component.final 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 thespeedRetentionrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ALLOWED_FLUIDS
-
SPEED_RETENTION
JSON field key for the surface movement speed multiplier.- See Also:
-
KEY
-
KEY_PROVIDER
Supplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
CODEC
Codec for serializing and deserializingFluidWalkerEffectinstances from JSON.
-
-
Constructor Details
-
FluidWalkerEffect
public FluidWalkerEffect(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids, net.minecraft.world.item.enchantment.LevelBasedValue speedRetention) Creates an instance of aFluidWalkerEffectrecord class.- Parameters:
allowedFluids- the value for theallowedFluidsrecord componentspeedRetention- the value for thespeedRetentionrecord 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). -
allowedFluids
public net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids()Returns the value of theallowedFluidsrecord component.- Specified by:
allowedFluidsin interfaceFluidWalkerDefinition- Returns:
- the value of the
allowedFluidsrecord component
-
speedRetention
public net.minecraft.world.item.enchantment.LevelBasedValue speedRetention()Returns the value of thespeedRetentionrecord component.- Specified by:
speedRetentionin interfaceFluidWalkerDefinition- Returns:
- the value of the
speedRetentionrecord component
-