LogoSubtle Effects

Spark Providers

The information of this page relates to Spark Providers from Subtle Effects version 1.14.0 and up, for versions below 1.14.0 please visit the legacy wiki

Setup

Spark providers allow resource packs to add, remove, and otherwise customize spark particles for blocks. To start, create a new JSON file in the assets/{namespace}/subtle_effects/spark_providers folder of a resource pack. Next, inside the file create a list called states.

{
"states": [
]
}

This list is where you provide the block states that this provider will spawn sparks for. States are made up of two main parts, the block id, and an optional list of block state properties that the block must match. Any unspecified properties will be ignored. For example, campfires have a waterlogged property, but since it is not specified in the example below it will be ignored and sparks will spawn regardless of whether the campfire is waterlogged or not. For a full list of vanilla block states please refer to this page

{
"states": [
{
"name": "minecraft:campfire",
"properties": {
"lit": "true"
}
}
]
...
}

Additionally a required boolean type element can optionally be added to an entry, which allows blocks to be specified that may not exist in the game e.g. blocks from a mod that hasn't been installed.

Options

Options are an optional element for customizing the color and behavior of sparks. If omitted, the provider will do nothing, making for an easy way to remove providers added by other packs/mods. To do so, put the provider in the same namespace with the same file name as an existing provider and load your pack above the other.

Options require that you define a preset type which will control the spawn behavior of the sparks. This can be any of:

NameRequirements
campfireN/A
fireThe block inherits from the BaseFireBlock class
torchN/A
wall_torchThe block has the horizontal facing property
candleThe block inherits from the AbstractCandleBlock class
lanternN/A
furnaceThe block has the horizontal facing property
customN/A
{
...
"options": {
"preset": "campfire"
}
}

List of all additional optional elements for customizing behavior

If preset is set to custom then the following elements may also be used

  • count An integer or Int Provider specifying the number of particles spawned at a time
  • spark The Spark Type to use.
  • chance A float from 0 to 1 of the chance that particles will be spawn during a random game tick
  • velocity A list of exactly three doubles used for velocity of the particles. Each double representing the X, Y, and Z axises respectively
  • box An element containing two lists of exactly three doubles. Each double represents the XYZ coordinates in blocks, relative to the spawning block, that will be used for the start and end positions of the box that the particles are spawned in. To specify pixels, multiply the number of pixels you want times 0.0625, which is the result of dividing 1 by 16 pixels, 1 being a single block and 16 being the default number of pixels in block.

(not found)Spark Types

NameSummaryApproximate Lifetime
short_lifeRises upwards1 second
long_lifeRises upwards2 seconds
floatingDrifts around in the air1 second
metalHas gravity1 second

Example of all options in use

{
...
"options": {
"preset": "custom",
"color": "0x7ABAAB",
"count": {
"type": "uniform",
"max_inclusive": 5,
"min_inclusive": 2
},
"spark": "long_life",
"chance": 0.25,
"velocity": [0.5, 0, -0.3],
"box": {
"min": [0, 0, 0],
"max": [1, 1, 1]
}
}
}