Interface FluidVariantAttributeHandler
public interface FluidVariantAttributeHandler
Defines the common attributes of fluid variants of a given Fluid.
Register with
FluidVariantAttributes.register(Fluid, FluidVariantAttributeHandler).-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<net.minecraft.sounds.SoundEvent> getEmptySound(FluidVariant variant) Return the sound corresponding to this fluid being emptied, or none if no sound is available.default Optional<net.minecraft.sounds.SoundEvent> getFillSound(FluidVariant variant) Return the sound corresponding to this fluid being filled, or none if no sound is available.default intgetLightEmission(FluidVariant variant) Return an integer in [0, 15]: the light level emitted by this fluid, or 0 if it doesn't naturally emit light.default net.minecraft.network.chat.ComponentgetName(FluidVariant fluidVariant) Return the name that should be used for the passed fluid variant.default intgetTemperature(FluidVariant variant) Return a non-negative integer, representing the temperature of this fluid in Kelvin.default intgetViscosity(FluidVariant variant, @Nullable net.minecraft.world.level.Level level) Return a positive integer, representing the viscosity of this fluid.default booleanisLighterThanAir(FluidVariant variant) Return true if this fluid is lighter than air.
-
Method Details
-
getName
Return the name that should be used for the passed fluid variant. -
getFillSound
Return the sound corresponding to this fluid being filled, or none if no sound is available.If a non-empty sound event is returned,
Fluid.getPickupSound()will return that sound. -
getEmptySound
Return the sound corresponding to this fluid being emptied, or none if no sound is available.If a non-empty sound event is returned,
BucketItem.playEmptySound(LivingEntity, LevelAccessor, BlockPos)will play that sound. -
getLightEmission
Return an integer in [0, 15]: the light level emitted by this fluid, or 0 if it doesn't naturally emit light. -
getTemperature
-
getViscosity
Return a positive integer, representing the viscosity of this fluid. Fluids with lower viscosity generally flow faster than fluids with higher viscosity.More precisely, viscosity should be 200 *
Fluid.getTickDelay(LevelReader)for flowing fluids. The reference values are 1000 for water, 2000 for lava in ultrawarm dimensions (such as the nether), and 6000 for lava in other dimensions.- Parameters:
level- Level if available, otherwise null.
-
isLighterThanAir
Return true if this fluid is lighter than air. Fluids that are lighter than air generally flow upwards.
-