Class Particle
- Direct Known Subclasses:
BillboardParticle,ElderGuardianAppearanceParticle,ItemPickupParticle,NoRenderParticle
Particle is a client-side visual effect with position, velocity, collision, and additional render properties.
Each Particle is typically rendered as a camera-facing texture quad.
SpriteBillboardParticle provides this behavior, and most vanilla particles inherit from it.
If you would like a Particle with no direct rendering effects, inherit from NoRenderParticle.
- Mappings:
Namespace Name official ezyintermediary net/minecraft/class_703named net/minecraft/client/particle/Particle
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected floatprotected floatprotected floatprivate Boxprotected booleanprotected booleanprivate static final Boxprivate booleanprotected booleanprotected floatprotected floatprivate static final doubleprotected intprotected booleanprotected floatprotected doubleprotected doubleprotected doubleprotected final Randomprotected floatprotected floatprotected floatprotected floatprotected doubleprotected doubleprotected doubleprotected final ClientWorldprotected doubleprotected doubleprotected double -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedParticle(ClientWorld world, double x, double y, double z) Particle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidbuildGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta) Renders thisParticleto the givenVertexConsumerbuffer.Returns the boundingBoxof this particle, which is used for collision and movement logic.protected intgetBrightness(float tint) getGroup()Returns the optional group that this particle belongs to.intReturns the maximum age, in ticks, of this particle.abstract ParticleTextureSheetgetType()Returns the rendering category thisParticleis rendered under.booleanisAlive()voidmarkDead()Marks thisParticleas ready to be removed from the containingClientWorld.voidmove(double dx, double dy, double dz) Moves thisParticleby the specified delta amounts, re-positioning bounding boxes and adjusting movement for collision with the world.move(float speed) Multiplies thisParticle's current velocity by the targetspeedamount.protected voidscale(float scale) Scales the size of this particle by the givenscaleamount.protected voidsetAlpha(float alpha) Updates the alpha value of thisParticleto use while rendering.voidsetBoundingBox(Box boundingBox) protected voidsetBoundingBoxSpacing(float spacingXZ, float spacingY) voidsetColor(float red, float green, float blue) Updates the rendering color of this particle.voidsetMaxAge(int maxAge) Sets the maximum age, in ticks, that this particle can exist for.voidsetPos(double x, double y, double z) voidsetVelocity(double velocityX, double velocityY, double velocityZ) Updates thisParticle's velocity to the target X, Y, and Z values.voidtick()This method is called each game tick (20 times per second), and should be used to do coreParticlelogic, such as movement and collision.toString()
-
Field Details
-
EMPTY_BOUNDING_BOX
- Mappings:
Namespace Name Mixin selector official aLezy;a:Ldyz;intermediary field_3860Lnet/minecraft/class_703;field_3860:Lnet/minecraft/class_238;named EMPTY_BOUNDING_BOXLnet/minecraft/client/particle/Particle;EMPTY_BOUNDING_BOX:Lnet/minecraft/util/math/Box;
-
MAX_SQUARED_COLLISION_CHECK_DISTANCE
private static final double MAX_SQUARED_COLLISION_CHECK_DISTANCE- Mappings:
Namespace Name Mixin selector official bLezy;b:Dintermediary field_36193Lnet/minecraft/class_703;field_36193:Dnamed MAX_SQUARED_COLLISION_CHECK_DISTANCELnet/minecraft/client/particle/Particle;MAX_SQUARED_COLLISION_CHECK_DISTANCE:D
-
world
- Mappings:
Namespace Name Mixin selector official cLezy;c:Lexk;intermediary field_3851Lnet/minecraft/class_703;field_3851:Lnet/minecraft/class_638;named worldLnet/minecraft/client/particle/Particle;world:Lnet/minecraft/client/world/ClientWorld;
-
prevPosX
protected double prevPosX- Mappings:
Namespace Name Mixin selector official dLezy;d:Dintermediary field_3858Lnet/minecraft/class_703;field_3858:Dnamed prevPosXLnet/minecraft/client/particle/Particle;prevPosX:D
-
prevPosY
protected double prevPosY- Mappings:
Namespace Name Mixin selector official eLezy;e:Dintermediary field_3838Lnet/minecraft/class_703;field_3838:Dnamed prevPosYLnet/minecraft/client/particle/Particle;prevPosY:D
-
prevPosZ
protected double prevPosZ- Mappings:
Namespace Name Mixin selector official fLezy;f:Dintermediary field_3856Lnet/minecraft/class_703;field_3856:Dnamed prevPosZLnet/minecraft/client/particle/Particle;prevPosZ:D
-
x
protected double x- Mappings:
Namespace Name Mixin selector official gLezy;g:Dintermediary field_3874Lnet/minecraft/class_703;field_3874:Dnamed xLnet/minecraft/client/particle/Particle;x:D
-
y
protected double y- Mappings:
Namespace Name Mixin selector official hLezy;h:Dintermediary field_3854Lnet/minecraft/class_703;field_3854:Dnamed yLnet/minecraft/client/particle/Particle;y:D
-
z
protected double z- Mappings:
Namespace Name Mixin selector official iLezy;i:Dintermediary field_3871Lnet/minecraft/class_703;field_3871:Dnamed zLnet/minecraft/client/particle/Particle;z:D
-
velocityX
protected double velocityX- Mappings:
Namespace Name Mixin selector official jLezy;j:Dintermediary field_3852Lnet/minecraft/class_703;field_3852:Dnamed velocityXLnet/minecraft/client/particle/Particle;velocityX:D
-
velocityY
protected double velocityY- Mappings:
Namespace Name Mixin selector official kLezy;k:Dintermediary field_3869Lnet/minecraft/class_703;field_3869:Dnamed velocityYLnet/minecraft/client/particle/Particle;velocityY:D
-
velocityZ
protected double velocityZ- Mappings:
Namespace Name Mixin selector official lLezy;l:Dintermediary field_3850Lnet/minecraft/class_703;field_3850:Dnamed velocityZLnet/minecraft/client/particle/Particle;velocityZ:D
-
boundingBox
- Mappings:
Namespace Name Mixin selector official DLezy;D:Ldyz;intermediary field_3872Lnet/minecraft/class_703;field_3872:Lnet/minecraft/class_238;named boundingBoxLnet/minecraft/client/particle/Particle;boundingBox:Lnet/minecraft/util/math/Box;
-
onGround
protected boolean onGround- Mappings:
Namespace Name Mixin selector official mLezy;m:Zintermediary field_3845Lnet/minecraft/class_703;field_3845:Znamed onGroundLnet/minecraft/client/particle/Particle;onGround:Z
-
collidesWithWorld
protected boolean collidesWithWorld- Mappings:
Namespace Name Mixin selector official nLezy;n:Zintermediary field_3862Lnet/minecraft/class_703;field_3862:Znamed collidesWithWorldLnet/minecraft/client/particle/Particle;collidesWithWorld:Z
-
field_21507
private boolean field_21507- Mappings:
Namespace Name Mixin selector official ELezy;E:Zintermediary field_21507Lnet/minecraft/class_703;field_21507:Znamed field_21507Lnet/minecraft/client/particle/Particle;field_21507:Z
-
dead
protected boolean dead- Mappings:
Namespace Name Mixin selector official oLezy;o:Zintermediary field_3843Lnet/minecraft/class_703;field_3843:Znamed deadLnet/minecraft/client/particle/Particle;dead:Z
-
spacingXZ
protected float spacingXZ- Mappings:
Namespace Name Mixin selector official pLezy;p:Fintermediary field_3849Lnet/minecraft/class_703;field_3849:Fnamed spacingXZLnet/minecraft/client/particle/Particle;spacingXZ:F
-
spacingY
protected float spacingY- Mappings:
Namespace Name Mixin selector official qLezy;q:Fintermediary field_3867Lnet/minecraft/class_703;field_3867:Fnamed spacingYLnet/minecraft/client/particle/Particle;spacingY:F
-
random
- Mappings:
Namespace Name Mixin selector official rLezy;r:Lanu;intermediary field_3840Lnet/minecraft/class_703;field_3840:Lnet/minecraft/class_5819;named randomLnet/minecraft/client/particle/Particle;random:Lnet/minecraft/util/math/random/Random;
-
age
protected int age- Mappings:
Namespace Name Mixin selector official sLezy;s:Iintermediary field_3866Lnet/minecraft/class_703;field_3866:Inamed ageLnet/minecraft/client/particle/Particle;age:I
-
maxAge
protected int maxAge- Mappings:
Namespace Name Mixin selector official tLezy;t:Iintermediary field_3847Lnet/minecraft/class_703;field_3847:Inamed maxAgeLnet/minecraft/client/particle/Particle;maxAge:I
-
gravityStrength
protected float gravityStrength- Mappings:
Namespace Name Mixin selector official uLezy;u:Fintermediary field_3844Lnet/minecraft/class_703;field_3844:Fnamed gravityStrengthLnet/minecraft/client/particle/Particle;gravityStrength:F
-
red
protected float red- Mappings:
Namespace Name Mixin selector official vLezy;v:Fintermediary field_3861Lnet/minecraft/class_703;field_3861:Fnamed redLnet/minecraft/client/particle/Particle;red:F
-
green
protected float green- Mappings:
Namespace Name Mixin selector official wLezy;w:Fintermediary field_3842Lnet/minecraft/class_703;field_3842:Fnamed greenLnet/minecraft/client/particle/Particle;green:F
-
blue
protected float blue- Mappings:
Namespace Name Mixin selector official xLezy;x:Fintermediary field_3859Lnet/minecraft/class_703;field_3859:Fnamed blueLnet/minecraft/client/particle/Particle;blue:F
-
alpha
protected float alpha- Mappings:
Namespace Name Mixin selector official yLezy;y:Fintermediary field_3841Lnet/minecraft/class_703;field_3841:Fnamed alphaLnet/minecraft/client/particle/Particle;alpha:F
-
angle
protected float angle- Mappings:
Namespace Name Mixin selector official zLezy;z:Fintermediary field_3839Lnet/minecraft/class_703;field_3839:Fnamed angleLnet/minecraft/client/particle/Particle;angle:F
-
prevAngle
protected float prevAngle- Mappings:
Namespace Name Mixin selector official ALezy;A:Fintermediary field_3857Lnet/minecraft/class_703;field_3857:Fnamed prevAngleLnet/minecraft/client/particle/Particle;prevAngle:F
-
velocityMultiplier
protected float velocityMultiplier- Mappings:
Namespace Name Mixin selector official BLezy;B:Fintermediary field_28786Lnet/minecraft/class_703;field_28786:Fnamed velocityMultiplierLnet/minecraft/client/particle/Particle;velocityMultiplier:F
-
field_28787
protected boolean field_28787- Mappings:
Namespace Name Mixin selector official CLezy;C:Zintermediary field_28787Lnet/minecraft/class_703;field_28787:Znamed field_28787Lnet/minecraft/client/particle/Particle;field_28787:Z
-
-
Constructor Details
-
Particle
- Mappings:
Namespace Name Mixin selector official <init>Lezy;<init>(Lexk;DDD)Vintermediary <init>Lnet/minecraft/class_703;<init>(Lnet/minecraft/class_638;DDD)Vnamed <init>Lnet/minecraft/client/particle/Particle;<init>(Lnet/minecraft/client/world/ClientWorld;DDD)V
-
Particle
public Particle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) - Mappings:
Namespace Name Mixin selector official <init>Lezy;<init>(Lexk;DDDDDD)Vintermediary <init>Lnet/minecraft/class_703;<init>(Lnet/minecraft/class_638;DDDDDD)Vnamed <init>Lnet/minecraft/client/particle/Particle;<init>(Lnet/minecraft/client/world/ClientWorld;DDDDDD)V
-
-
Method Details
-
move
Multiplies thisParticle's current velocity by the targetspeedamount.- Parameters:
speed- the velocity multiplier to apply to thisParticle- Mappings:
Namespace Name Mixin selector official cLezy;c(F)Lezy;intermediary method_3075Lnet/minecraft/class_703;method_3075(F)Lnet/minecraft/class_703;named moveLnet/minecraft/client/particle/Particle;move(F)Lnet/minecraft/client/particle/Particle;
-
setVelocity
public void setVelocity(double velocityX, double velocityY, double velocityZ) Updates thisParticle's velocity to the target X, Y, and Z values.- Parameters:
velocityX- the new x-velocity of thisParticlevelocityY- the new y-velocity of thisParticlevelocityZ- the new z-velocity of thisParticle- Mappings:
Namespace Name Mixin selector official bLezy;b(DDD)Vintermediary method_34753Lnet/minecraft/class_703;method_34753(DDD)Vnamed setVelocityLnet/minecraft/client/particle/Particle;setVelocity(DDD)V
-
scale
Scales the size of this particle by the givenscaleamount.- Parameters:
scale- the amount to scale this particle's size by- Returns:
- this
Particle - Mappings:
Namespace Name Mixin selector official dLezy;d(F)Lezy;intermediary method_3087Lnet/minecraft/class_703;method_3087(F)Lnet/minecraft/class_703;named scaleLnet/minecraft/client/particle/Particle;scale(F)Lnet/minecraft/client/particle/Particle;
-
setColor
public void setColor(float red, float green, float blue) Updates the rendering color of this particle. Each value should be between 0.0 (no channel color) and 1.0 (full channel color).- Parameters:
red- the target red color to use while renderinggreen- the target green color to use while renderingblue- the target blue color to use while rendering- Mappings:
Namespace Name Mixin selector official aLezy;a(FFF)Vintermediary method_3084Lnet/minecraft/class_703;method_3084(FFF)Vnamed setColorLnet/minecraft/client/particle/Particle;setColor(FFF)V
-
setAlpha
protected void setAlpha(float alpha) Updates the alpha value of thisParticleto use while rendering.Note that a
Particlecannot render with transparency unlessgetType()isParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT, or another sheet that supports transparency.Also note that the default particle shader (core/particle.fsh) will discard all transparent pixels below 0.1 alpha.
- Parameters:
alpha- the new alpha value of this particle- Mappings:
Namespace Name Mixin selector official eLezy;e(F)Vintermediary method_3083Lnet/minecraft/class_703;method_3083(F)Vnamed setAlphaLnet/minecraft/client/particle/Particle;setAlpha(F)V
-
setMaxAge
public void setMaxAge(int maxAge) Sets the maximum age, in ticks, that this particle can exist for.- Parameters:
maxAge- the new maximum age of thisParticle, in ticks- Mappings:
Namespace Name Mixin selector official aLezy;a(I)Vintermediary method_3077Lnet/minecraft/class_703;method_3077(I)Vnamed setMaxAgeLnet/minecraft/client/particle/Particle;setMaxAge(I)V
-
getMaxAge
public int getMaxAge()Returns the maximum age, in ticks, of this particle. If this particle's age exceeds this value, it will be removed from the world.- Returns:
- this particle's maximum age, in ticks
- Mappings:
Namespace Name Mixin selector official jLezy;j()Iintermediary method_3082Lnet/minecraft/class_703;method_3082()Inamed getMaxAgeLnet/minecraft/client/particle/Particle;getMaxAge()I
-
tick
public void tick()This method is called each game tick (20 times per second), and should be used to do coreParticlelogic, such as movement and collision.- Mappings:
Namespace Name Mixin selector official aLezy;a()Vintermediary method_3070Lnet/minecraft/class_703;method_3070()Vnamed tickLnet/minecraft/client/particle/Particle;tick()V
-
buildGeometry
Renders thisParticleto the givenVertexConsumerbuffer.- Parameters:
vertexConsumer- the buffer to render tocamera- the current active gameCameratickDelta- frame tick delta amount- Mappings:
Namespace Name Mixin selector official aLezy;a(Ledh;Lehs;F)Vintermediary method_3074Lnet/minecraft/class_703;method_3074(Lnet/minecraft/class_4588;Lnet/minecraft/class_4184;F)Vnamed buildGeometryLnet/minecraft/client/particle/Particle;buildGeometry(Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/client/render/Camera;F)V
-
getType
Returns the rendering category thisParticleis rendered under.For more information on the properties and types available to each
Particle, visitParticleTextureSheet.- Returns:
- the
ParticleTextureSheetanyParticleof this type will render through - Mappings:
Namespace Name Mixin selector official bLezy;b()Lfac;intermediary method_18122Lnet/minecraft/class_703;method_18122()Lnet/minecraft/class_3999;named getTypeLnet/minecraft/client/particle/Particle;getType()Lnet/minecraft/client/particle/ParticleTextureSheet;
-
toString
-
markDead
public void markDead()Marks thisParticleas ready to be removed from the containingClientWorld.- Mappings:
Namespace Name Mixin selector official kLezy;k()Vintermediary method_3085Lnet/minecraft/class_703;method_3085()Vnamed markDeadLnet/minecraft/client/particle/Particle;markDead()V
-
setBoundingBoxSpacing
protected void setBoundingBoxSpacing(float spacingXZ, float spacingY) - Mappings:
Namespace Name Mixin selector official bLezy;b(FF)Vintermediary method_3080Lnet/minecraft/class_703;method_3080(FF)Vnamed setBoundingBoxSpacingLnet/minecraft/client/particle/Particle;setBoundingBoxSpacing(FF)V
-
setPos
public void setPos(double x, double y, double z) - Parameters:
x- the x position to move this particle toy- the y position to move this particle toz- the z position to move this particle to- Mappings:
Namespace Name Mixin selector official cLezy;c(DDD)Vintermediary method_3063Lnet/minecraft/class_703;method_3063(DDD)Vnamed setPosLnet/minecraft/client/particle/Particle;setPos(DDD)V
-
move
public void move(double dx, double dy, double dz) Moves thisParticleby the specified delta amounts, re-positioning bounding boxes and adjusting movement for collision with the world.- Parameters:
dx- the delta x to move this particle bydy- the delta y to move this particle bydz- the delta z to move this particle by- Mappings:
Namespace Name Mixin selector official aLezy;a(DDD)Vintermediary method_3069Lnet/minecraft/class_703;method_3069(DDD)Vnamed moveLnet/minecraft/client/particle/Particle;move(DDD)V
-
repositionFromBoundingBox
protected void repositionFromBoundingBox()- Mappings:
Namespace Name Mixin selector official lLezy;l()Vintermediary method_3072Lnet/minecraft/class_703;method_3072()Vnamed repositionFromBoundingBoxLnet/minecraft/client/particle/Particle;repositionFromBoundingBox()V
-
getBrightness
protected int getBrightness(float tint) - Returns:
- the packed light level this particle should render at
- See Also:
- Mappings:
Namespace Name Mixin selector official aLezy;a(F)Iintermediary method_3068Lnet/minecraft/class_703;method_3068(F)Inamed getBrightnessLnet/minecraft/client/particle/Particle;getBrightness(F)I
-
isAlive
public boolean isAlive()- Returns:
falseif this particle is finished invalid input: '&' should be removed from the parentParticleManager, otherwisetrueif the particle is still alive- Mappings:
Namespace Name Mixin selector official mLezy;m()Zintermediary method_3086Lnet/minecraft/class_703;method_3086()Znamed isAliveLnet/minecraft/client/particle/Particle;isAlive()Z
-
getBoundingBox
Returns the boundingBoxof this particle, which is used for collision and movement logic.By default, this bounding box is automatically repositioned when a particle moves in
tick(). To adjust the size of the returned box, visitsetBoundingBoxSpacing(float, float). To directly update the current bounding box, visitsetBoundingBox(Box);- Returns:
- the bounding
Boxof this particle, used for collision and movement - Mappings:
Namespace Name Mixin selector official nLezy;n()Ldyz;intermediary method_3064Lnet/minecraft/class_703;method_3064()Lnet/minecraft/class_238;named getBoundingBoxLnet/minecraft/client/particle/Particle;getBoundingBox()Lnet/minecraft/util/math/Box;
-
setBoundingBox
- Mappings:
Namespace Name Mixin selector official aLezy;a(Ldyz;)Vintermediary method_3067Lnet/minecraft/class_703;method_3067(Lnet/minecraft/class_238;)Vnamed setBoundingBoxLnet/minecraft/client/particle/Particle;setBoundingBox(Lnet/minecraft/util/math/Box;)V
-
getGroup
Returns the optional group that this particle belongs to.A particle group restricts the number of particles from the group that can be rendered in a client world. If the particle does not have a group, it is not restricted.
- Returns:
- the optional group that this particle belongs to
- Mappings:
Namespace Name Mixin selector official oLezy;o()Ljava/util/Optional;intermediary method_34019Lnet/minecraft/class_703;method_34019()Ljava/util/Optional;named getGroupLnet/minecraft/client/particle/Particle;getGroup()Ljava/util/Optional;
-