Pack Making JSON Particles - DonBruce64/MinecraftTransportSimulator GitHub Wiki

Particles are used to spawn particles. No big surprise here. Particles consist of a few different types, each with their own behavior. However, if you wish to modify that behavior you may do so by specifying one of the optional parameters. This allows for things like suspended smoke and color-changing effects.

Required Parameters

  • type – Which type of particle to use. Can be one of the following:
  • smoke – The standard smoke particle. Slowly floats up.
  • flame – The standard flame particle. Slowly gets bigger and floats up a bit. Also will be rendered bright, even at night.
  • bubble – The standard bubble particle. Slowly floats up in water. De-spawns when in air.
  • break – Block breakage particles, spawned to match the texture of the block below the particle's spawning location.
  • casing - A casing particle. This renders the model/texture as defined on the bullet in the gun that spawns this.
  • generic – A generic particle. Doesn't have any pre-defined movement except some of the default randomness in initial velocity and age all particles have. Useful if you want to make particles that have specific movement that doesn't fix existing types.
  • spawningOrientation - Defines, what the particle is supposed to spawn relative to:
  • entity - Particle spawns relative to the entity that spawned it.
  • attached - Particle spawns attached to the entity that spawned it, and moves with that entity.
  • world - Particle spawns relative to the world and ignores entity orientation.
  • facing - Particle spawns relative to to the face orientation where the bullet that spawned it hit. If this is an air burst that didn't hit anything, or isn't on a bullet, it will not be spawned.
  • renderingOrientation - Defines, what the particle is supposed to face/rotate to:
  • fixed - Particle does not rotate and orients as spawned. Can be rotated with "rot": [x,y,z].
  • player - Particle rotates to always face the player.
  • yaxis - Particle rotates to face the player, but only about the Y-axis.
  • motion - Particle rotates to face its motion. Think bullets.
  • activeAnimations - A listing of conditions for determining if this particle should spawn. Particles will only spawn when they first become active, unless spawnEveryTick is set.

Optional Parameters

  • spawnEveryTick - Forces this particle to spawn every tick it is active. Useful for constant particle flows, like smoke.

  • isBright - If true, this particle will ignore lighting and will render bright at all times. Useful for muzzle flashes and sparks.

  • isBlended - If true, this particle will do brightness blending. Ignored if the user has blendedLights as false in their config.

  • daytimeReductionFactor - Reduces alpha by this factor during daytime. A value of 1 means the particle will be invisible during full daylight, decimals (0.0->1.0) for partial brightness during daytime are supported.

  • useBlockColor - If true, the particle will use the block color of the block it is spawned from. Valid only on break type particles.

  • getBlockPropertiesFromGround - If true, the particle will use the block properties from the ground below it, no matter how far down the ground is, vs the properties of the block at the position it is at.

  • stopsOnGround - If true, this particle will immediately freeze all movement the moment its hitbox touches any block. Useful for things that should stay on the ground a litte longer like spent casings.

  • ignoreCollision - Makes the particle ignore collision with all blocks. Can and should be used on particles that don't need collision, since this takes up CPU cycles and can lead to odd behavior on occasion if particles are spawned inside blocks.

  • groundSounds - A random sound from this list of sounds will play when the particle stops on the ground / when stopsOnGround is true. Format for each entry is [packID:soundName]

  • 3D-Particles - These two parameters are required to make a particle render as a 3D object:

  • model - You need to insert a path to your desired model here. Format: packID:path/to/model.obj
  • texture - Like model, you need to provide a path to a texture for that model here. Format: packID:path/to/texture.png
  • randomTexture - Normally, textureList starts with the first texture. Setting this true starts from a random spot. If textureDelays is null, then it'll just pick a random texture and stick with it. Otherwise, it will cycle as normal.
  • quantity - How many of this particle to spawn at a time. Defaults to 1.
  • duration - How long, in ticks, the particle should remain. If not set, the age will be auto-calculated the same way it would be if spawned naturally in-game.
  • movementDuration - If set, the particle will linearly change its speed from the intialVelocity, to 0, after this many ticks. If the particle is still present after this, it will not move. If the particle's duration is less than this value, then the particle will only slow down according to the linear interpolation and will never stop. Note that movementVelocity and terminalVelocity is still applied if applicable, so the velocity may not follow this exact value if those are present.
  • transparency - A number between 0.0 and 1.0 describing how transparent the particle should be. If both this and toTransparency are not set, they are assumed to be 1.0 for both and no transparency changes will be performed.
  • toTransparency - Like above, but tells the particle to gradually change from its initial transparency to this value. If transparency is set and non-zero, then this defaults to 0.0. Othwerise, it is used as-is.
  • fadeInTransparencyTime - The time, in ticks, for the particle to fade in at the start of its lifespan. Particles fade by multiplying their defined alpha times the relative time-value of this value. So if fade-in time is 10, and the particle is 5 ticks from spawn, alpha will be half of what is defined (5/10).
  • fadeOutTransparencyTime - The time, in ticks, for the particle to fade out at the end of its lifespan. Particles fade by multiplying their defined alpha times the relative time-value of this value. So if fade-out time is 40, and the particle is 20 ticks from death, alpha will be half of what is defined (20/40).
  • scale - "How big to spawn each particle. A value of 1.0 will result in 1 pixel of the particle texture per 1 pixel in-game. This is the default if this is not set.
  • toScale - Like above, but tells the particle to gradually change from its initial scale to this value. Defaults to 1.0 if this and scale are not set.
  • fadeInScaleTime - The time, in ticks, for the particle to scale in at the start of its lifespan. Particles scale by multiplying their defined scale times the relative time-value of this value. So if fade-in time is 10, and the particle is 5 ticks from spawn, scale will be half of what is defined (5/10).
  • fadeOutScaleTime - The time, in ticks, for the particle to scale out at the end of its lifespan. Particles scale by multiplying their defined scale times the relative time-value of this value. So if fade-out time is 40, and the particle is 20 ticks from death, scale will be half of what is defined (20/40).
  • hitboxSize - The size of the particles hitbox, in blocks. The default size is 0.2.
  • texture - Normally particles use built-in textures. However, one can specify a texture sheet to use if they wish. Format is packID:path/to/texture.
  • textureList - If you want your particle to have multiple textures, you can specify the texture PNG files to use here. The delay between each texture segment is goverend by the textureDelay variable, if it is set. If you delay past the last texture, the cycle repeats.
  • textureDelay - A list of delays between cycling to the next texture. If the end of this list is reached, the delay sequence will repeat from the start of the list.
  • color - A Color Value representing the particle's color. Defaults to white if not set, which essentially does no color modification.
  • toColor - Like above, but tells the particle to gradually change from its initial color to this value. Defaults to be the same as the initial color if not set.
  • colorList - If you want your particle to have multiple colors, you can specify the colors to use here. The delay between each color is goverend by the colorDelay variable, if it is set. If you delay past the last color, the cycle repeats.
  • colorDelays - A list of delays between cycling to the next color. If the end of this list is reached, the delay sequence will repeat from the start of the list.
  • randomColor - Normally, colorList starts with the first color. Setting this true starts from a random spot. If colorDelays is null, then it'll just pick a random color and stick with it. Otherwise, it will cycle as normal.
  • distance - distance of particles spawned in blocks. Its like spawnEveryTick but on stereoids. Useful for allowing even fast moving objects like jets and rockets to have a seamless particle trail.
  • pos - The position where this particle should be spawned relative to the spawning object. May be left out if the particle should spawn at the same position.
  • rot - The rotation to rotate this particle to. Only has an effect for FIXED orientation particles, as do all other rotational parameters.
  • rotationRandomness - These angles [x,y,z] (in degrees) will be randomly added to rot, multipled by a random value between -1 and 1.
  • rotationVelocity - The angles [x,y,z] in degrees to rotate this particle by every tick.
  • spreadRandomness - This velocity [x,y,z] will be randomly added to the initialVelocity, multipled by a random value between -1 and 1.
  • relativeInheritedVelocityFactor - The factor of which to inherit the spawning velocity of the thing that is producing it, where +Z is straight ahead relative to the thing that is producing it. If left out, no inherited velocity is assumed.
  • initialVelocity - The initial velocity of the particle, where +Z is straight ahead relative to the thing that is producing it. May be omitted to make a particle that doesn't spawn with any initial velocity except the velocity of the object spawning it.
  • movementVelocity - The velocity to apply every tick to the particle. This can be used to make smoke float up, oil drip down, etc. If this and relativeMovementVelocity is not set, the default particle velocity is used.
  • relativeMovementVelocity - The velocity to apply every tick to the particle, relative the the particle itself. This differs from movementVelocity, which is relative to the world.
  • terminalVelocity - The max velocity this particle can have in any axis. Used to prevent particles from going to fast if they move a long way. If not set, velocity will be assumed to be infinite.
  • subParticles - A list of subParticle objects. Each object consists of the following parameters:
  • time - How many ticks after this particle has been active, should the subParticle be spawned.
  • particle - The particle to spawn. This is the same format as particles, and can include other subParticles itself.