Class VfxEffects

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.VfxEffects

public final class VfxEffects extends Object
World effects by name, so the server can start them with VfxControl.play. Register from a ClientModConstructor:
VfxEffects.register(MyMod.id("impact"), (level, params) -> {
    WorldParticles.burst(EMBER, params.position(), Math.round(20 * params.scale()), 0.1, 0.15);
    WorldVfx.flash(VfxMaterial.additive(VfxMaterial.GLOW), params.position(), Curve.of(0.2F, 1.2F), 0xFF000000 | params.color(), 6);
});
  • Method Details

    • register

      public static void register(net.minecraft.resources.Identifier id, VfxEffect effect)
      Registers an effect under an id; registering it again replaces it.
    • unregister

      public static void unregister(net.minecraft.resources.Identifier id)
    • play

      public static boolean play(net.minecraft.resources.Identifier id, VfxParams params)
      Plays a registered effect on this client alone. Returns false if nothing is registered under the id.