Create custom particles in vanilla minecraft using this vanilla shader resource pack
If you want to try it out before fully setting it up, you can do so
- Download this repo by clicking on the green
Code
button and then onDownload ZIP
- Place the downloaded
.zip
file into yourresourcepacks
folder - Ingame, select the resource pack
- Run this command:
particle entity_effect{ color: [ .12, .36, .15, .98 ]}
You should see a green 12
flying up from your feet
- Move the shader file into your resource pack at the same location (
assets/minecraft/shaders/core/particle.vsh
) - Move the particle textures into your resource pack at the same location (
assets/minecraft/textures/particle
) - Modify one of the 99 placeholder textures in all of the particle texture files, the files
effect_7
toeffect_0
represent the evolution of the particle over time - Optionally adjust the header pixel row above
Remember the numbers on the placeholder texture you modified, the numbers are the X and Y offset from the original texture and are required for the particle
command
Use the offset numbers in the particle command like this:
particle entity_effect{ color: [ .XY, .36, .15, .98 ]}
Replace X and Y with the X and Y offset where you placed your custom particle texture
You can use all other features of the particle command just like normal aswell (speed, amount, location, ...)
Above the actual particle texture, you will find a row of empty pixels, these can change how the particle behaves
If a header pixel is not at full transparency, it will be ignored and defaulted
-
The first header pixel overwrites the
8
x8
texture size of the particle, with the red channel being X size and the blue channel being Y sizeSo a pixel with the color
rgba(16, 16, 0, 255)
would determine, that the texture starts where it would normally but extends16
pixels down and rightYes, that will "overwrite" the space reserved for other particle textures and render those practically unuseable
As an example, you can look at the particle at position
8
,8
in the provided files, that takes up17
x17
pixels -
The second header pixel changes the scale of the particle in the world, with it's green channel representing the size
A pixel of color
rgba(0, 0, 0, 255)
will make the particle small, a pixel with the colorrgba(0, 255, 0, 255)
will make the particle big, the colorrgba(0, 15, 0, 255)
represents the default scaleAs an example, you can loot at the particle at position
2
,2
in the provided files, that is set to maximum scale
- This pack requires minecraft 1.20.5 or higher (Tested in 23w14a)
- This pack is incompatible with modded shaders
- This pack should work with most other mods (Like Optifine/Sodium)
- Compatible with other vanilla shaders that dont replace the
particle.vsh
file
If another vanilla shader resource pack modifies the particle.vsh
file, you should be able to easily merge it by adding the new variables (annotated using comments) and the lower block of code (annotated using comments) at the end of the other shader's main
function