Interface FluidBehavior.Builder
- Enclosing interface:
FluidBehavior
@NonExtendable
public static interface FluidBehavior.Builder
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionallowBoats(boolean value) Allows boats to float on this fluid.allowMovingDown(boolean value) Toggles ability to move down faster in fluid when pressing shift.allowSprinting(boolean value) Allows players to sprint in this fluid.allowSprinting(BiPredicate<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>, net.minecraft.world.entity.LivingEntity> predicate) Allows players to sprint in this fluid.allowSprinting(Predicate<net.minecraft.world.entity.LivingEntity> predicate) Allows players to sprint in this fluid.allowSwimming(boolean value) Allows players to sprint-swim in this fluid.build()Builds the fluid behavior.enableDrowning(boolean value) Allows mobs to drown in fluid.fallDistanceModifier(float value) Modifies the applied fall distance when falling or entirely clears it at 0.flowingPushScale(double value) Sets the flowing fluid pushing strength.gravityMultiplier(float value) Sets the gravity multiplier.makeMobsFloat(boolean value) Allows mobs to float in fluid.makeRiddenMobsFloat(boolean value) Allows ridden mobs to float in fluid.movementSlowdown(float value) Controls the movement slowdown multiplier (applied to stored speed).movementSlowdown(float horizontal, float vertical) Controls the movement slowdown multiplier (applied to stored speed).Controls the movement slowdown multiplier (applied to stored speed).movementSlowdown(net.minecraft.util.ToFloatFunction<net.minecraft.world.entity.LivingEntity> function) Controls the movement slowdown multiplier (applied to stored speed).movementSpeed(float value) Controls the movement speed multiplier (applied speed when moving).movementSpeed(net.minecraft.util.ToFloatFunction<net.minecraft.world.entity.LivingEntity> function) Controls the movement speed multiplier (applied speed when moving).
-
Method Details
-
movementSpeed
Controls the movement speed multiplier (applied speed when moving). Defaults to 0.02.- Parameters:
value- value to set- Returns:
- this builder
-
movementSpeed
FluidBehavior.Builder movementSpeed(net.minecraft.util.ToFloatFunction<net.minecraft.world.entity.LivingEntity> function) Controls the movement speed multiplier (applied speed when moving). Defaults to 0.02.- Parameters:
function- source of the multiplier- Returns:
- this builder
-
movementSlowdown
Controls the movement slowdown multiplier (applied to stored speed). Defaults to 0.65 horizontally and 0.8 vertically.- Parameters:
value- value to set- Returns:
- this builder
-
movementSlowdown
Controls the movement slowdown multiplier (applied to stored speed). Defaults to 0.65 horizontally and 0.8 vertically.- Parameters:
horizontal- horizontal multiplier value to setvertical- horizontal multiplier value to set- Returns:
- this builder
-
movementSlowdown
FluidBehavior.Builder movementSlowdown(net.minecraft.util.ToFloatFunction<net.minecraft.world.entity.LivingEntity> function) Controls the movement slowdown multiplier (applied to stored speed). Defaults to 0.65 horizontally and 0.8 vertically.- Parameters:
function- source of the multiplier- Returns:
- this builder
-
movementSlowdown
Controls the movement slowdown multiplier (applied to stored speed). Defaults to 0.65 horizontally and 0.8 vertically.- Parameters:
function- source of the multiplier- Returns:
- this builder
-
fallDistanceModifier
Modifies the applied fall distance when falling or entirely clears it at 0. Defaults to 0.- Parameters:
value- value to set- Returns:
- this builder
-
gravityMultiplier
Sets the gravity multiplier. Defaults to 1 / 16f- Parameters:
value- value to set- Returns:
- this builder
-
flowingPushScale
Sets the flowing fluid pushing strength. Defaults to 0.014 (water push strength)- Parameters:
value- value to set- Returns:
- this builder
-
allowMovingDown
Toggles ability to move down faster in fluid when pressing shift. Defaults to false.- Parameters:
value- value to set- Returns:
- this builder
-
allowBoats
Allows boats to float on this fluid. Defaults to false.- Parameters:
value- value to set- Returns:
- this builder
-
allowSwimming
Allows players to sprint-swim in this fluid. Defaults to false.- Parameters:
value- value to set- Returns:
- this builder
-
allowSprinting
Allows players to sprint in this fluid. Defaults to true.- Parameters:
value- value to set- Returns:
- this builder
-
allowSprinting
Allows players to sprint in this fluid. Defaults to true.- Parameters:
predicate- value to set- Returns:
- this builder
-
allowSprinting
FluidBehavior.Builder allowSprinting(BiPredicate<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>, net.minecraft.world.entity.LivingEntity> predicate) Allows players to sprint in this fluid. Defaults to true.- Parameters:
predicate- value to set- Returns:
- this builder
-
makeMobsFloat
Allows mobs to float in fluid. Defaults to true.- Parameters:
value- value to set- Returns:
- this builder
-
makeRiddenMobsFloat
Allows ridden mobs to float in fluid. Defaults to false.- Parameters:
value- value to set- Returns:
- this builder
-
enableDrowning
Allows mobs to drown in fluid. Defaults to false.- Parameters:
value- value to set- Returns:
- this builder
-
build
-