Interface ControlledParticle
@NonExtendable
public interface ControlledParticle
Accessor interface for a particle controlled by a
ParticleControllerInstance.-
Method Summary
Modifier and TypeMethodDescriptionfloatgetAlpha()intgetColor()intnet.minecraft.world.phys.Vec3getPos()doublehorizontalDistanceTo(net.minecraft.world.phys.Vec3 vec) booleannet.minecraft.client.multiplayer.ClientLevellevel()voidmove(double x, double y, double z) Moves the particle by the specified amounts.net.minecraft.util.RandomSourcerandom()net.minecraft.client.particle.Particlescale(float scale) voidsetAlpha(float alpha) voidsetColor(int color) voidsetLifetime(int lifetime) voidsetParticleSpeed(double x, double y, double z) Sets the speed of the particle.voidsetPos(double x, double y, double z) Sets the position of the particle.voidsetRemoved(boolean removed) Sets the particle to be removed.doublex()doubley()doublez()
-
Method Details
-
isRemoved
boolean isRemoved()- Returns:
- Whether the particle is removed.
-
setRemoved
void setRemoved(boolean removed) Sets the particle to be removed.- Parameters:
removed- The removal state to set.
-
x
double x()- Returns:
- The x position of the particle.
-
y
double y()- Returns:
- The y position of the particle.
-
z
double z()- Returns:
- The z position of the particle.
-
getPos
net.minecraft.world.phys.Vec3 getPos()- Returns:
- The position of the particle.
-
setPos
void setPos(double x, double y, double z) Sets the position of the particle.- Parameters:
x- The x position to set.y- The y position to set.z- The z position to set.
-
setParticleSpeed
void setParticleSpeed(double x, double y, double z) Sets the speed of the particle.- Parameters:
x- The x speed to set.y- The y speed to set.z- The z speed to set.
-
getColor
int getColor()- Returns:
- The color of the particle.
-
setColor
void setColor(int color) - Parameters:
color- The color to set.
-
getAlpha
float getAlpha()- Returns:
- The alpha value of the particle.
-
setAlpha
void setAlpha(float alpha) - Parameters:
alpha- The alpha value to set.
-
level
net.minecraft.client.multiplayer.ClientLevel level()- Returns:
- The
ClientLevelthe particle is in.
-
random
net.minecraft.util.RandomSource random()- Returns:
- The particle's
RandomSource.
-
getLifetime
int getLifetime()- Returns:
- The particle's lifetime.
-
setLifetime
void setLifetime(int lifetime) - Parameters:
lifetime- The lifetime to set.
-
horizontalDistanceTo
double horizontalDistanceTo(net.minecraft.world.phys.Vec3 vec) - Parameters:
vec- TheVec3to measure the horizontal distance to.- Returns:
- The horizontal distance between the particle and the given
Vec3.
-
scale
net.minecraft.client.particle.Particle scale(float scale) - Parameters:
scale- The scale factor to apply.- Returns:
- The particle.
-
move
void move(double x, double y, double z) Moves the particle by the specified amounts.- Parameters:
x- The amount to move by in x direction.y- The amount to move by in y direction.z- The amount to move by in z direction.
-