Class Particle

java.lang.Object
net.minecraft.client.particle.Particle
Direct Known Subclasses:
BillboardParticle, ElderGuardianParticle, ItemPickupParticle, NoRenderParticle

@Environment(CLIENT) public abstract class Particle extends Object
A client-side visual effect with position, velocity, collision, and additional render properties.

Each particle is typically rendered as a camera-facing texture quad.

invalid reference
net.minecraft.client.particle.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
named net/minecraft/client/particle/Particle
intermediary net/minecraft/class_703
official hcy
  • Field Details

    • EMPTY_BOUNDING_BOX

      private static final Box EMPTY_BOUNDING_BOX
      Mappings:
      Namespace Name Mixin selector
      named EMPTY_BOUNDING_BOX Lnet/minecraft/client/particle/Particle;EMPTY_BOUNDING_BOX:Lnet/minecraft/util/math/Box;
      intermediary field_3860 Lnet/minecraft/class_703;field_3860:Lnet/minecraft/class_238;
      official a Lhcy;a:Lfoc;
    • MAX_SQUARED_COLLISION_CHECK_DISTANCE

      private static final double MAX_SQUARED_COLLISION_CHECK_DISTANCE
      Mappings:
      Namespace Name Mixin selector
      named MAX_SQUARED_COLLISION_CHECK_DISTANCE Lnet/minecraft/client/particle/Particle;MAX_SQUARED_COLLISION_CHECK_DISTANCE:D
      intermediary field_36193 Lnet/minecraft/class_703;field_36193:D
      official b Lhcy;b:D
    • world

      protected final ClientWorld world
      Mappings:
      Namespace Name Mixin selector
      named world Lnet/minecraft/client/particle/Particle;world:Lnet/minecraft/client/world/ClientWorld;
      intermediary field_3851 Lnet/minecraft/class_703;field_3851:Lnet/minecraft/class_638;
      official j Lhcy;j:Lgzn;
    • lastX

      protected double lastX
      Mappings:
      Namespace Name Mixin selector
      named lastX Lnet/minecraft/client/particle/Particle;lastX:D
      intermediary field_3858 Lnet/minecraft/class_703;field_3858:D
      official k Lhcy;k:D
    • lastY

      protected double lastY
      Mappings:
      Namespace Name Mixin selector
      named lastY Lnet/minecraft/client/particle/Particle;lastY:D
      intermediary field_3838 Lnet/minecraft/class_703;field_3838:D
      official l Lhcy;l:D
    • lastZ

      protected double lastZ
      Mappings:
      Namespace Name Mixin selector
      named lastZ Lnet/minecraft/client/particle/Particle;lastZ:D
      intermediary field_3856 Lnet/minecraft/class_703;field_3856:D
      official m Lhcy;m:D
    • x

      protected double x
      Mappings:
      Namespace Name Mixin selector
      named x Lnet/minecraft/client/particle/Particle;x:D
      intermediary field_3874 Lnet/minecraft/class_703;field_3874:D
      official n Lhcy;n:D
    • y

      protected double y
      Mappings:
      Namespace Name Mixin selector
      named y Lnet/minecraft/client/particle/Particle;y:D
      intermediary field_3854 Lnet/minecraft/class_703;field_3854:D
      official o Lhcy;o:D
    • z

      protected double z
      Mappings:
      Namespace Name Mixin selector
      named z Lnet/minecraft/client/particle/Particle;z:D
      intermediary field_3871 Lnet/minecraft/class_703;field_3871:D
      official p Lhcy;p:D
    • velocityX

      protected double velocityX
      Mappings:
      Namespace Name Mixin selector
      named velocityX Lnet/minecraft/client/particle/Particle;velocityX:D
      intermediary field_3852 Lnet/minecraft/class_703;field_3852:D
      official q Lhcy;q:D
    • velocityY

      protected double velocityY
      Mappings:
      Namespace Name Mixin selector
      named velocityY Lnet/minecraft/client/particle/Particle;velocityY:D
      intermediary field_3869 Lnet/minecraft/class_703;field_3869:D
      official r Lhcy;r:D
    • velocityZ

      protected double velocityZ
      Mappings:
      Namespace Name Mixin selector
      named velocityZ Lnet/minecraft/client/particle/Particle;velocityZ:D
      intermediary field_3850 Lnet/minecraft/class_703;field_3850:D
      official s Lhcy;s:D
    • boundingBox

      private Box boundingBox
      Mappings:
      Namespace Name Mixin selector
      named boundingBox Lnet/minecraft/client/particle/Particle;boundingBox:Lnet/minecraft/util/math/Box;
      intermediary field_3872 Lnet/minecraft/class_703;field_3872:Lnet/minecraft/class_238;
      official c Lhcy;c:Lfoc;
    • onGround

      protected boolean onGround
      Mappings:
      Namespace Name Mixin selector
      named onGround Lnet/minecraft/client/particle/Particle;onGround:Z
      intermediary field_3845 Lnet/minecraft/class_703;field_3845:Z
      official t Lhcy;t:Z
    • collidesWithWorld

      protected boolean collidesWithWorld
      Mappings:
      Namespace Name Mixin selector
      named collidesWithWorld Lnet/minecraft/client/particle/Particle;collidesWithWorld:Z
      intermediary field_3862 Lnet/minecraft/class_703;field_3862:Z
      official u Lhcy;u:Z
    • stopped

      private boolean stopped
      Mappings:
      Namespace Name Mixin selector
      named stopped Lnet/minecraft/client/particle/Particle;stopped:Z
      intermediary field_21507 Lnet/minecraft/class_703;field_21507:Z
      official d Lhcy;d:Z
    • dead

      protected boolean dead
      Mappings:
      Namespace Name Mixin selector
      named dead Lnet/minecraft/client/particle/Particle;dead:Z
      intermediary field_3843 Lnet/minecraft/class_703;field_3843:Z
      official v Lhcy;v:Z
    • spacingXZ

      protected float spacingXZ
      Mappings:
      Namespace Name Mixin selector
      named spacingXZ Lnet/minecraft/client/particle/Particle;spacingXZ:F
      intermediary field_3849 Lnet/minecraft/class_703;field_3849:F
      official w Lhcy;w:F
    • spacingY

      protected float spacingY
      Mappings:
      Namespace Name Mixin selector
      named spacingY Lnet/minecraft/client/particle/Particle;spacingY:F
      intermediary field_3867 Lnet/minecraft/class_703;field_3867:F
      official x Lhcy;x:F
    • random

      protected final Random random
      Mappings:
      Namespace Name Mixin selector
      named random Lnet/minecraft/client/particle/Particle;random:Lnet/minecraft/util/math/random/Random;
      intermediary field_3840 Lnet/minecraft/class_703;field_3840:Lnet/minecraft/class_5819;
      official y Lhcy;y:Lbfq;
    • age

      protected int age
      Mappings:
      Namespace Name Mixin selector
      named age Lnet/minecraft/client/particle/Particle;age:I
      intermediary field_3866 Lnet/minecraft/class_703;field_3866:I
      official z Lhcy;z:I
    • maxAge

      protected int maxAge
      Mappings:
      Namespace Name Mixin selector
      named maxAge Lnet/minecraft/client/particle/Particle;maxAge:I
      intermediary field_3847 Lnet/minecraft/class_703;field_3847:I
      official A Lhcy;A:I
    • gravityStrength

      protected float gravityStrength
      Mappings:
      Namespace Name Mixin selector
      named gravityStrength Lnet/minecraft/client/particle/Particle;gravityStrength:F
      intermediary field_3844 Lnet/minecraft/class_703;field_3844:F
      official B Lhcy;B:F
    • velocityMultiplier

      protected float velocityMultiplier
      Mappings:
      Namespace Name Mixin selector
      named velocityMultiplier Lnet/minecraft/client/particle/Particle;velocityMultiplier:F
      intermediary field_28786 Lnet/minecraft/class_703;field_28786:F
      official C Lhcy;C:F
    • ascending

      protected boolean ascending
      Mappings:
      Namespace Name Mixin selector
      named ascending Lnet/minecraft/client/particle/Particle;ascending:Z
      intermediary field_28787 Lnet/minecraft/class_703;field_28787:Z
      official D Lhcy;D:Z
  • Constructor Details

    • Particle

      protected Particle(ClientWorld world, double x, double y, double z)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/particle/Particle;<init>(Lnet/minecraft/client/world/ClientWorld;DDD)V
      intermediary <init> Lnet/minecraft/class_703;<init>(Lnet/minecraft/class_638;DDD)V
      official <init> Lhcy;<init>(Lgzn;DDD)V
    • Particle

      public Particle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/particle/Particle;<init>(Lnet/minecraft/client/world/ClientWorld;DDDDDD)V
      intermediary <init> Lnet/minecraft/class_703;<init>(Lnet/minecraft/class_638;DDDDDD)V
      official <init> Lhcy;<init>(Lgzn;DDDDDD)V
  • Method Details

    • move

      public Particle move(float speed)
      Multiplies this particle's current velocity by the target speed amount.
      Parameters:
      speed - the velocity multiplier to apply to this particle
      Mappings:
      Namespace Name Mixin selector
      named move Lnet/minecraft/client/particle/Particle;move(F)Lnet/minecraft/client/particle/Particle;
      intermediary method_3075 Lnet/minecraft/class_703;method_3075(F)Lnet/minecraft/class_703;
      official c Lhcy;c(F)Lhcy;
    • setVelocity

      public void setVelocity(double velocityX, double velocityY, double velocityZ)
      Updates this particle's velocity to the target X, Y, and Z values.
      Parameters:
      velocityX - the new x-velocity of this particle
      velocityY - the new y-velocity of this particle
      velocityZ - the new z-velocity of this particle
      Mappings:
      Namespace Name Mixin selector
      named setVelocity Lnet/minecraft/client/particle/Particle;setVelocity(DDD)V
      intermediary method_34753 Lnet/minecraft/class_703;method_34753(DDD)V
      official b Lhcy;b(DDD)V
    • scale

      public Particle scale(float scale)
      Scales the size of this particle by the given scale amount.
      Parameters:
      scale - the amount to scale this particle's size by
      Returns:
      this particle
      Mappings:
      Namespace Name Mixin selector
      named scale Lnet/minecraft/client/particle/Particle;scale(F)Lnet/minecraft/client/particle/Particle;
      intermediary method_3087 Lnet/minecraft/class_703;method_3087(F)Lnet/minecraft/class_703;
      official d Lhcy;d(F)Lhcy;
    • 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 this particle, in ticks
      Mappings:
      Namespace Name Mixin selector
      named setMaxAge Lnet/minecraft/client/particle/Particle;setMaxAge(I)V
      intermediary method_3077 Lnet/minecraft/class_703;method_3077(I)V
      official a Lhcy;a(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:
      the maximum age, in ticks, of this particle
      Mappings:
      Namespace Name Mixin selector
      named getMaxAge Lnet/minecraft/client/particle/Particle;getMaxAge()I
      intermediary method_3082 Lnet/minecraft/class_703;method_3082()I
      official j Lhcy;j()I
    • tick

      public void tick()
      Called each game tick (20 times per second), and should be used to do core particle logic, such as movement and collision.
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/client/particle/Particle;tick()V
      intermediary method_3070 Lnet/minecraft/class_703;method_3070()V
      official a Lhcy;a()V
    • textureSheet

      public abstract ParticleTextureSheet textureSheet()
      Mappings:
      Namespace Name Mixin selector
      named textureSheet Lnet/minecraft/client/particle/Particle;textureSheet()Lnet/minecraft/client/particle/ParticleTextureSheet;
      intermediary method_74274 Lnet/minecraft/class_703;method_74274()Lnet/minecraft/class_3999;
      official bj_ Lhcy;bj_()Lhdd;
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • markDead

      public void markDead()
      Marks this particle as ready to be removed from the containing ClientWorld.
      Mappings:
      Namespace Name Mixin selector
      named markDead Lnet/minecraft/client/particle/Particle;markDead()V
      intermediary method_3085 Lnet/minecraft/class_703;method_3085()V
      official k Lhcy;k()V
    • setBoundingBoxSpacing

      protected void setBoundingBoxSpacing(float spacingXZ, float spacingY)
      Mappings:
      Namespace Name Mixin selector
      named setBoundingBoxSpacing Lnet/minecraft/client/particle/Particle;setBoundingBoxSpacing(FF)V
      intermediary method_3080 Lnet/minecraft/class_703;method_3080(FF)V
      official b Lhcy;b(FF)V
    • setPos

      public void setPos(double x, double y, double z)
      Updates the position and bounding box of this particle to the target x, y, z position.
      Parameters:
      x - the x position to move this particle to
      y - the y position to move this particle to
      z - the z position to move this particle to
      Mappings:
      Namespace Name Mixin selector
      named setPos Lnet/minecraft/client/particle/Particle;setPos(DDD)V
      intermediary method_3063 Lnet/minecraft/class_703;method_3063(DDD)V
      official c Lhcy;c(DDD)V
    • move

      public void move(double dx, double dy, double dz)
      Moves this particle by 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 by
      dy - the delta y to move this particle by
      dz - the delta z to move this particle by
      Mappings:
      Namespace Name Mixin selector
      named move Lnet/minecraft/client/particle/Particle;move(DDD)V
      intermediary method_3069 Lnet/minecraft/class_703;method_3069(DDD)V
      official a Lhcy;a(DDD)V
    • repositionFromBoundingBox

      protected void repositionFromBoundingBox()
      Mappings:
      Namespace Name Mixin selector
      named repositionFromBoundingBox Lnet/minecraft/client/particle/Particle;repositionFromBoundingBox()V
      intermediary method_3072 Lnet/minecraft/class_703;method_3072()V
      official l Lhcy;l()V
    • getBrightness

      protected int getBrightness(float tint)
      Returns the packed light level this particle should render at.
      Returns:
      the packed light level this particle should render at
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getBrightness Lnet/minecraft/client/particle/Particle;getBrightness(F)I
      intermediary method_3068 Lnet/minecraft/class_703;method_3068(F)I
      official a Lhcy;a(F)I
    • isAlive

      public boolean isAlive()
      Returns false if this particle is finished and should be removed from the parent ParticleManager, otherwise true if the particle is still alive.
      Returns:
      false if this particle is finished and should be removed from the parent ParticleManager, otherwise true if the particle is still alive
      Mappings:
      Namespace Name Mixin selector
      named isAlive Lnet/minecraft/client/particle/Particle;isAlive()Z
      intermediary method_3086 Lnet/minecraft/class_703;method_3086()Z
      official m Lhcy;m()Z
    • getBoundingBox

      public Box getBoundingBox()
      Returns the bounding Box of this particle 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, visit setBoundingBoxSpacing(float, float). To directly update the current bounding box, visit setBoundingBox(Box);

      Returns:
      the bounding Box of this particle used for collision and movement logic
      Mappings:
      Namespace Name Mixin selector
      named getBoundingBox Lnet/minecraft/client/particle/Particle;getBoundingBox()Lnet/minecraft/util/math/Box;
      intermediary method_3064 Lnet/minecraft/class_703;method_3064()Lnet/minecraft/class_238;
      official n Lhcy;n()Lfoc;
    • setBoundingBox

      public void setBoundingBox(Box boundingBox)
      Mappings:
      Namespace Name Mixin selector
      named setBoundingBox Lnet/minecraft/client/particle/Particle;setBoundingBox(Lnet/minecraft/util/math/Box;)V
      intermediary method_3067 Lnet/minecraft/class_703;method_3067(Lnet/minecraft/class_238;)V
      official a Lhcy;a(Lfoc;)V
    • getGroup

      public Optional<ParticleGroup> 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
      named getGroup Lnet/minecraft/client/particle/Particle;getGroup()Ljava/util/Optional;
      intermediary method_34019 Lnet/minecraft/class_703;method_34019()Ljava/util/Optional;
      official o Lhcy;o()Ljava/util/Optional;