public class LineEffect extends TargetedYPREffect
  • Field Details

    • isZigZag

      public boolean isZigZag
      Should it do a zig zag?
    • zigZags

      public int zigZags
      Number of zig zags in the line
    • zigZagOffset

      public net.minecraft.util.math.Vec3d zigZagOffset
      Direction of zig-zags
    • zigZagRelativeOffset

      public net.minecraft.util.math.Vec3d zigZagRelativeOffset
      Relative direction of zig-zags
    • particles

      public int particles
      Particles per arc
    • length

      public double length
      Length of arc A non-zero value here will use a length instead of the target endpoint
    • maxLength

      public double maxLength
      Max length of arc A non-zero value here will use this as the upper bound for the computed length
    • zag

      protected boolean zag
      Internal boolean
    • step

      protected int step
      Internal counter
  • Constructor Details

    • LineEffect

      public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset, Effect effectAtEnd)
      Creates a new line effect.
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the line
      yaw - The yaw of the effect. For example, you can get it from an Entity using getYaw()
      pitch - The pitch of the effect. For example, you can get it from an Entity using getPitch()
      particles - The number of particles that make up the line
      length - The length of the line
      isZigZag - Should the line ZigZag
      numberOfZigZags - The number of zig zags that the line will do
      zigZagOffset - An offset for the zigZag
      zigZagRelativeOffset - A relative offsets for the zigzags
      effectAtEnd - Another Effect that will be spawned at the ending position of the line (its originPos will be set to the end of the line)
    • LineEffect

      public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset)
      Creates a new line effect.
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the line
      yaw - The yaw of the effect. For example, you can get it from an Entity using getYaw()
      pitch - The pitch of the effect. For example, you can get it from an Entity using getPitch()
      particles - The number of particles that make up the line
      length - The length of the line
      isZigZag - Should the line ZigZag
      numberOfZigZags - The number of zig zags that the line will do
      zigZagOffset - An offset for the zigZag
      zigZagRelativeOffset - A relative offsets for the zigzags
    • LineEffect

      public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles, double length)
      Creates a new line effect.
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the line
      yaw - The yaw of the effect. For example, you can get it from an Entity using getYaw()
      pitch - The pitch of the effect. For example, you can get it from an Entity using getPitch()
      particles - The number of particles that make up the line
      length - The length of the line
    • LineEffect

      public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, net.minecraft.util.math.Vec3d target, int particles, int maxLength, boolean isZigZag, int numberOfZigZags, net.minecraft.util.math.Vec3d zigZagOffset, net.minecraft.util.math.Vec3d zigZagRelativeOffset)
      Creates a new line effect.
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the line
      target - The ending position of the line
      particles - The number of particles that make up the line
      maxLength - The Max length of the line arcs. Setting to 0 will remove the limit
      isZigZag - Should the line ZigZag
      numberOfZigZags - The number of zig zags that the line will do
      zigZagOffset - An offset for the zigZag
      zigZagRelativeOffset - A relative offsets for the zigzags
    • LineEffect

      public LineEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, net.minecraft.util.math.Vec3d target, int particles)
      Creates a new line effect.
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the line
      target - The ending position of the line
      particles - The number of particles that make up the line
  • Method Details

    • copy

      public static void copy(LineEffect original, LineEffect copy)
    • builder

      public static LineEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos)
      Returns a builder for the effect.
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      originPos - The origin position of the effect

      Setting a world, a particle effect and an origin position is ALWAYS mandatory, hence their presence in this method! If this is an effect that uses Yaw and Pitch, remember to set those as well!

    • onRun

      public void onRun()
      Description copied from class: Effect
      Main method to extend, here the animation code is run EACH tick
      Overrides:
      onRun in class Effect
    • isZigZag

      public boolean isZigZag()
    • setZigZag

      public void setZigZag(boolean zigZag)
    • getZigZags

      public int getZigZags()
    • setZigZags

      public void setZigZags(int zigZags)
    • getZigZagOffset

      public net.minecraft.util.math.Vec3d getZigZagOffset()
    • setZigZagOffset

      public void setZigZagOffset(net.minecraft.util.math.Vec3d zigZagOffset)
    • getZigZagRelativeOffset

      public net.minecraft.util.math.Vec3d getZigZagRelativeOffset()
    • setZigZagRelativeOffset

      public void setZigZagRelativeOffset(net.minecraft.util.math.Vec3d zigZagRelativeOffset)
    • getParticles

      public int getParticles()
    • setParticles

      public void setParticles(int particles)
    • getLength

      public double getLength()
    • setLength

      public void setLength(double length)
    • getMaxLength

      public double getMaxLength()
    • setMaxLength

      public void setMaxLength(double maxLength)
    • getSubEffectAtEnd

      public Effect getSubEffectAtEnd()
    • setSubEffectAtEnd

      public void setSubEffectAtEnd(Effect subEffectAtEnd)