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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe registered type of aParticleController. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <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) net.minecraft.resources.Identifierid()booleanbooleanvoidtick(ParticleControllerInstance instance) Ticks the givenParticleControllerInstance.default voidtickFirst(ParticleControllerInstance instance) Ticks the givenParticleControllerInstanceon its first tick.
-
Field Details
-
CODEC
-
-
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- TheRecordCodecBuilder.Instanceto use.- Returns:
- A codec builder with the base fields for every controller set. Call
Products.P3.and(App)to add further fields.
-
tick
Ticks the givenParticleControllerInstance.- Parameters:
instance- TheParticleControllerInstanceto tick.
-
tickFirst
Ticks the givenParticleControllerInstanceon its first tick. Override this for special behavior on first tick.- Parameters:
instance- TheParticleControllerInstanceto 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.
-