public class CuboidEffect extends TargetedEffect
  • Field Details

    • particles

      public int particles
      Particles in each row
    • xLength

      public double xLength
      Length of x component of cuboid
    • yLength

      public double yLength
      Length of y component of cuboid
    • zLength

      public double zLength
      Length of z component of cuboid
    • padding

      public double padding
      Amount of padding to add around the cube
    • blockSnap

      public boolean blockSnap
      Use corners of blocks
    • minCorner

      protected net.minecraft.util.math.Vec3d minCorner
      State variables
  • Constructor Details

    • CuboidEffect

      @Deprecated public CuboidEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, @NotNull @NotNull net.minecraft.particle.ParticleEffect particle, @NotNull @NotNull net.minecraft.util.math.Vec3d origin, @NotNull @NotNull net.minecraft.util.math.Vec3d target, int particles_per_row, double x_length, double y_length, double z_length, double padding, boolean blockSnap)
      Deprecated.
      Creates a new cuboid effect. Don't use this constructor, since xyz lengths and origin-target exclude each other
      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 effect, aka the first corner of the cuboid
      target - The target position of the effect, aka the opposite corner of the cuboid
      particles_per_row - How many particles should each side/row have
      x_length - The length of the x component of the cuboid. The minimum is 1 block
      y_length - The length of the y component of the cuboid. The minimum is 1 block
      z_length - The length of the z component of the cuboid. The minimum is 1 block
      padding - The padding to add to the sides of the cuboid. A padding of 0.5 will result in having the effect closer to the border of a block, a padding of 0 will place the effect in the middle of a block
      blockSnap - Weather or not the corners should snap to blocks to be more precise.
    • CuboidEffect

      public CuboidEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, @NotNull @NotNull net.minecraft.particle.ParticleEffect particle, @NotNull @NotNull net.minecraft.util.math.Vec3d origin, @NotNull @NotNull net.minecraft.util.math.Vec3d target, int particles_per_row, double padding, boolean blockSnap)
      Creates a new cuboid 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 effect, aka the first corner of the cuboid
      target - The target position of the effect, aka the opposite corner of the cuboid
      particles_per_row - How many particles should each side/row have
      padding - The padding to add to the sides of the cuboid. A padding of 0.5 will result in having the effect closer to the border of a block, a padding of 0 will place the effect in the middle of a block
      blockSnap - Weather or not the corners should snap to blocks to be more precise.
    • CuboidEffect

      public CuboidEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, @NotNull @NotNull net.minecraft.particle.ParticleEffect particle, @NotNull @NotNull net.minecraft.util.math.Vec3d origin, int particles_per_row, double x_length, double y_length, double z_length, double padding, boolean blockSnap)
      Creates a new cuboid 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 effect, aka the first corner of the cuboid
      particles_per_row - How many particles should each side/row have
      x_length - The length of the x component of the cuboid. The minimum is 1 block.
      y_length - The length of the y component of the cuboid. The minimum is 1 block
      z_length - The length of the z component of the cuboid. The minimum is 1 block
      padding - The padding to add to the sides of the cuboid. A padding of 0.5 will result in having the effect closer to the border of a block, a padding of 0 will place the effect in the middle of a block
      blockSnap - Weather or not the corners should snap to blocks to be more precise.
    • CuboidEffect

      public CuboidEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, @NotNull @NotNull net.minecraft.particle.ParticleEffect particle, @NotNull @NotNull net.minecraft.util.math.Vec3d origin, int particles_per_row, double x_length, double y_length, double z_length)
      Creates a new cuboid 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 effect, aka the first corner of the cuboid
      particles_per_row - How many particles should each side/row have
      x_length - The length of the x component of the cuboid. The minimum is 1 block
      y_length - The length of the y component of the cuboid. The minimum is 1 block
      z_length - The length of the z component of the cuboid. The minimum is 1 block
    • CuboidEffect

      public CuboidEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, @NotNull @NotNull net.minecraft.particle.ParticleEffect particle, @NotNull @NotNull net.minecraft.util.math.Vec3d origin, @NotNull @NotNull net.minecraft.util.math.Vec3d target, int particles_per_row)
      Creates a new cuboid 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 effect, aka the first corner of the cuboid
      target - The target position of the effect, aka the opposite corner of the cuboid
      particles_per_row - How many particles should each side/row have
  • Method Details

    • copy

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

      public static CuboidEffect.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

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

      public double getXLength()
    • setXLength

      public void setXLength(double xLength)
    • getYLength

      public double getYLength()
    • setYLength

      public void setYLength(double yLength)
    • getZLength

      public double getZLength()
    • setZLength

      public void setZLength(double zLength)
    • getPadding

      public double getPadding()
    • setPadding

      public void setPadding(double padding)
    • isBlockSnap

      public boolean isBlockSnap()
    • setBlockSnap

      public void setBlockSnap(boolean blockSnap)
    • getParticles

      public int getParticles()
    • setParticles

      public void setParticles(int particles)