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 Summary

    Modifier and Type
    Method
    Description
    static boolean
    play(net.minecraft.resources.ResourceLocation id, VfxParams params)
    Plays a registered effect on this client alone.
    static void
    register(net.minecraft.resources.ResourceLocation id, VfxEffect effect)
    Registers an effect under an id; registering it again replaces it.
    static void
    unregister(net.minecraft.resources.ResourceLocation id)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • register

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

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

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