Class ColoredImageEffect


public class ColoredImageEffect extends BaseImageEffect
Draw an image or animated gif using colored particles
  • Constructor Details

    • ColoredImageEffect

      public ColoredImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String image_fileName)
    • ColoredImageEffect

      public ColoredImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image)
    • ColoredImageEffect

      public ColoredImageEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, String fileName, boolean transparency, int frameDelay, int stepX, int stepY, float scale, float particleSize, net.minecraft.util.math.Vec3d rotation, boolean orient, boolean enableRotation, BaseImageEffect.Plane plane, double angularVelocityX, double angularVelocityY, double angularVelocityZ)
      Creates a new Colored Image effect
      Parameters:
      world - The world the particles are going to spawn in
      origin - The origin position of the effect, aka the starting point of the cone
      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()
      fileName - The path and the name of the file that you want to display. It can also be an URL. Supported formats include jpg, png, gif
      transparency - If true transparent pixels will be transparent, otherwise they will be black.
      frameDelay - How many ticks to show each frame for
      stepX - How many pixel should be skipped on the X? Aka show only one pixel every *n* on the X plane
      stepY - How many pixel should be skipped on the Y? Aka show only one pixel every *n* on the Y plane
      scale - Scale factor for the image
      particleSize - How big should each individual Dust particle be? See also DustParticleEffect
      rotation - Apply a fixed rotation (independent of enableRotation)
      orient - Should the image orient towards yaw and pitch? For example orient to the player's facing direction
      enableRotation - Should it rotate?
      plane - What plane should it rotate?
      angularVelocityX - Turns the image by this angle each iteration around the x-axis (radians)
      angularVelocityY - Turns the image by this angle each iteration around the y-axis (radians)
      angularVelocityZ - Turns the image by this angle each iteration around the z-axis (radians)
  • Method Details

    • builder

      public static ColoredImageEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, String fileName)
      Returns a builder for the effect.
      Parameters:
      world - The world the particles are going to spawn in
      originPos - The origin position of the effect

      Setting a world, an image path 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!

      fileName - The path and the name of the file that you want to display. It can also be an URL. * You can also use new Identifier(modid, resource).getPath(). Supported formats include jpg, png, gif
    • builder

      public static ColoredImageEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.util.math.Vec3d originPos, net.minecraft.util.Identifier image)
      Returns a builder for the effect.
      Parameters:
      world - The world the particles are going to spawn in
      originPos - The origin position of the effect

      Setting a world, an image path 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!

      image - An identifier representing the image that will be displayed. The image must be placed in the /data/ folder and not the /assets/ folder!
    • display

      protected void display(BufferedImage image, net.minecraft.util.math.Vec3d v, net.minecraft.util.math.Vec3d pos, int pixel_color)
      Description copied from class: BaseImageEffect
      This method is to be overridden by extending classes such as ColoredImageEffect
      Specified by:
      display in class BaseImageEffect