Interface FluidBehavior.Builder

Enclosing interface:
FluidBehavior

@NonExtendable public static interface FluidBehavior.Builder
  • Method Details

    • movementSpeed

      FluidBehavior.Builder movementSpeed(float value)
      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

      FluidBehavior.Builder movementSlowdown(float value)
      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

      FluidBehavior.Builder movementSlowdown(float horizontal, float vertical)
      Controls the movement slowdown multiplier (applied to stored speed). Defaults to 0.65 horizontally and 0.8 vertically.
      Parameters:
      horizontal - horizontal multiplier value to set
      vertical - 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

      FluidBehavior.Builder fallDistanceModifier(float value)
      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

      FluidBehavior.Builder gravityMultiplier(float value)
      Sets the gravity multiplier. Defaults to 1 / 16f
      Parameters:
      value - value to set
      Returns:
      this builder
    • flowingPushScale

      FluidBehavior.Builder flowingPushScale(double value)
      Sets the flowing fluid pushing strength. Defaults to 0.014 (water push strength)
      Parameters:
      value - value to set
      Returns:
      this builder
    • allowMovingDown

      FluidBehavior.Builder allowMovingDown(boolean value)
      Toggles ability to move down faster in fluid when pressing shift. Defaults to false.
      Parameters:
      value - value to set
      Returns:
      this builder
    • allowBoats

      FluidBehavior.Builder allowBoats(boolean value)
      Allows boats to float on this fluid. Defaults to false.
      Parameters:
      value - value to set
      Returns:
      this builder
    • allowSwimming

      FluidBehavior.Builder allowSwimming(boolean value)
      Allows players to sprint-swim in this fluid. Defaults to false.
      Parameters:
      value - value to set
      Returns:
      this builder
    • allowSprinting

      FluidBehavior.Builder allowSprinting(boolean value)
      Allows players to sprint in this fluid. Defaults to true.
      Parameters:
      value - value to set
      Returns:
      this builder
    • allowSprinting

      FluidBehavior.Builder allowSprinting(Predicate<net.minecraft.world.entity.LivingEntity> predicate)
      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

      FluidBehavior.Builder makeMobsFloat(boolean value)
      Allows mobs to float in fluid. Defaults to true.
      Parameters:
      value - value to set
      Returns:
      this builder
    • makeRiddenMobsFloat

      FluidBehavior.Builder makeRiddenMobsFloat(boolean value)
      Allows ridden mobs to float in fluid. Defaults to false.
      Parameters:
      value - value to set
      Returns:
      this builder
    • enableDrowning

      FluidBehavior.Builder enableDrowning(boolean value)
      Allows mobs to drown in fluid. Defaults to false.
      Parameters:
      value - value to set
      Returns:
      this builder
    • build

      FluidBehavior build()
      Builds the fluid behavior.
      Returns:
      a new fluid behavior