Interface ParticleController


public interface ParticleController

Represents a particle controller, as serialized from a ParticleSpawner. To make a tickable instance, see ParticleControllerInstance.

Register ParticleControllers during RegisterParticleControllersEvent, using the ParticleController.Type record.

  • Field Details

  • Method Details

    • baseFields

      static <T extends ParticleController> com.mojang.datafixers.Products.P2<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<T>, Boolean, Boolean> baseFields(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<T> instance)
      Type Parameters:
      T - The exact type of the controller.
      Parameters:
      instance - The RecordCodecBuilder.Instance to use.
      Returns:
      A codec builder with the base fields for every controller set. Call Products.P3.and(App) to add further fields.
    • tick

      void tick(ParticleControllerInstance instance)
      Parameters:
      instance - The ParticleControllerInstance to tick.
    • tickFirst

      default void tickFirst(ParticleControllerInstance instance)
      Ticks the given ParticleControllerInstance on its first tick. Override this for special behavior on first tick.
      Parameters:
      instance - The ParticleControllerInstance to tick.
    • id

      net.minecraft.resources.Identifier id()
      Returns:
      The registered id of the controller.
    • stopOtherControllers

      boolean stopOtherControllers()
      Returns:
      Whether all further controllers are stopped when this controller is run.
    • killOnFinish

      boolean killOnFinish()
      Returns:
      Whether the particle should be removed after this controller has finished.