User Tools

Site Tools


tutorial:fluids

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:fluids [2026/02/20 12:08] – Migrated Names to Mojmap & updated text to 1.21.11 infinitychancestutorial:fluids [2026/02/23 14:26] (current) – fixed reference infinitychances
Line 256: Line 256:
 } }
 </code> </code>
 +===== Adding custom textures to your fluid =====
 +To create a fluid with custom textures, you will need at least 2 new textures, with an optional 3rd, overlay texture that is shown when you look at the fluid behind glass or leaves. All textures go in the block textures folder.
  
-If you want to use your own fluid texturesyou can refer to vanilla's assets ((''assets/minecraft/blockstates/water.json''\\ ''assets/minecraft/models/block/water.json''\\ ''assets/minecraft/textures/block/water_still.png''\\ ''assets/minecraft/textures/block/water_still.png.mcmeta''\\ ''assets/minecraft/textures/block/water_flow.png''\\ ''assets/minecraft/textures/block/water_flow.png.mcmeta'')) as a template.+The first texture should be named YOUR_FLUID_NAME_still.png, and can optionally be animated. 
 +The second texture should be named YOUR_FLUID_NAME_flowing.png, and should have double the size in the dimensions. For example, if your still texture has frames of 16x16the flowing should have frames of 32x32. It can also be animated. 
 +The third will be named YOUR_FLUID_NAME_overlay.png, and should not be animated. 
 + 
 +Using our acid example, the client initializer will look like this: 
 +<code java [enable_line_numbers="true"]> 
 +@Environment(EnvType.CLIENT) 
 +public class TutorialModClient implements ClientModInitializer { 
 + 
 + @Override 
 + public void onInitializeClient() { 
 + FluidRenderHandlerRegistry.INSTANCE.register(TutorialMod.ACID_SOURCE, TutorialMod.FLOWING_ACID, new SimpleFluidRenderHandler( 
 + Identifier.fromNamespaceAndPath("tutorial", "block/acid_still"), 
 + Identifier.fromNamespaceAndPath("tutorial", "block/acid_flowing"), 
 + Identifier.fromNamespaceAndPath("tutorial", "block/acid_overlay") /*optional tint can go after the overlay*/); 
 + 
 + BlockRenderLayerMap.putFluids(ChunkSectionLayer.TRANSLUCENT, TutorialMod.ACID_SOURCE, TutorialMod.FLOWING_ACID); 
 +
 +
 +</code> 
 + 
 +You can refer to vanilla's assets ((''assets/minecraft/textures/block/water_still.png''\\ ''assets/minecraft/textures/block/water_still.png.mcmeta''\\ ''assets/minecraft/textures/block/water_flow.png''\\ ''assets/minecraft/textures/block/water_flow.png.mcmeta'' \\ ''assets/minecraft/textures/block/water_overlay.png'')) as a template for your own textures.
  
tutorial/fluids.1771589304.txt.gz · Last modified: 2026/02/20 12:08 by infinitychances