Class RegisterParticleProvidersEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent
All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent

public class RegisterParticleProvidersEvent extends net.neoforged.bus.api.Event implements net.neoforged.fml.event.IModBusEvent
Fired for registering particle providers at the appropriate time.

ParticleTypes must be registered during RegisterEvent as usual; this event is only for the ParticleProviders.

This event is not cancellable, and does not

invalid reference
have a result
.

This event is fired on the mod-specific event bus, only on the logical client.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final net.minecraft.client.particle.ParticleEngine
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RegisterParticleProvidersEvent(net.minecraft.client.particle.ParticleEngine particleEngine)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends net.minecraft.core.particles.ParticleOptions>
    void
    registerSpecial(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleProvider<T> provider)
    Registers a ParticleProvider for a non-json-based ParticleType.
    <T extends net.minecraft.core.particles.ParticleOptions>
    void
    registerSprite(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleProvider.Sprite<T> sprite)
    Registers a ParticleProvider for a json-based ParticleType with a single texture; the resulting TextureSheetParticles will use that texture when created.
    <T extends net.minecraft.core.particles.ParticleOptions>
    void
    registerSpriteSet(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleEngine.SpriteParticleRegistration<T> registration)
    Registers a ParticleProvider for a json-based ParticleType.

    Methods inherited from class java.lang.Object

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

    • particleEngine

      private final net.minecraft.client.particle.ParticleEngine particleEngine
  • Constructor Details

    • RegisterParticleProvidersEvent

      @Internal public RegisterParticleProvidersEvent(net.minecraft.client.particle.ParticleEngine particleEngine)
  • Method Details

    • registerSpecial

      public <T extends net.minecraft.core.particles.ParticleOptions> void registerSpecial(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleProvider<T> provider)

      Registers a ParticleProvider for a non-json-based ParticleType. These particles do not receive a list of texture sprites to use for rendering themselves.

      There must be no particle json with an ID matching the ParticleType, or a redundant texture list error will occur when particle jsons load.

      Type Parameters:
      T - ParticleOptions used by the ParticleType and ParticleProvider.
      Parameters:
      type - ParticleType to register a ParticleProvider for.
      provider - ParticleProvider function responsible for providing that ParticleType's particles.
    • registerSprite

      public <T extends net.minecraft.core.particles.ParticleOptions> void registerSprite(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleProvider.Sprite<T> sprite)

      Registers a ParticleProvider for a json-based ParticleType with a single texture; the resulting TextureSheetParticles will use that texture when created.

      A particle json with an ID matching the ParticleType must exist in the particles asset folder, or a missing texture list error will occur when particle jsons load.

      Type Parameters:
      T - ParticleOptions used by the ParticleType and Sprite function.
      Parameters:
      type - ParticleType to register a ParticleProvider for.
      sprite - Sprite function responsible for providing that ParticleType's particles.
    • registerSpriteSet

      public <T extends net.minecraft.core.particles.ParticleOptions> void registerSpriteSet(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleEngine.SpriteParticleRegistration<T> registration)

      Registers a ParticleProvider for a json-based ParticleType. Particle jsons define a list of texture sprites which the particle can use to render itself.

      A particle json with an ID matching the ParticleType must exist in the particles asset folder, or a missing texture list error will occur when particle jsons load.

      Type Parameters:
      T - ParticleOptions used by the ParticleType and SpriteParticleRegistration function.
      Parameters:
      type - ParticleType to register a particle provider for.
      registration - SpriteParticleRegistration function responsible for providing that ParticleType's particles.