Bullet Particles - MUKSC/TaCZTweaks GitHub Wiki

Using bullet particles, you can add various particles to bullets.
In order to define a bullet particle, you need to create a data pack for it.
If you don't know how to make a data pack, please refer to other resources such as Minecraft Wiki.

Each bullet particle must be defined in a directory named bullet_particles.
For example: data/example/bullet_particles/example_particles.json

There are 2 types of bullet particles: block and entity, which are specified by the type field.

Block Particles

In block particles, you can make bullets emit particles on different situations.

{
    "type": "block",
    // Target, see the "Common Types" page
    // Accepts either a single object or a list of objects, and matches if any one of them is valid
    // Can be omitted and it will be used as a fallback, which will be used if no other particles are applicable
    "target": {
        "type": "ammo",
        "values": [
            "tacz:40mm"
        ]
    },
    // Specifies the target blocks for this particles, and matches if any one of them is valid
    // Accepts block ids, block tags, or any of the "Block Target" types (see the "Common Types" page)
    // Can be omitted and it will be used as a fallback, which will be used if no other particles are applicable
    "blocks": [
        "minecraft:stone",
        "#forge:glass",
        {
            "type": "regex",
            "range": "tacz:.+"
        }
    ],
    // All of the following 3 have the same data structure
    // Specifies the particle to emit on the corresponding situation
    // Accepts either a single object or a list of objects
    // Can be omitted and there will be no particle for it
    // Note: If the bullet pierces, the "pierce" particle will be emitted instead of the "hit" particle
    "hit": ...,
    "pierce": ...,
    "break": {
        // Specifies the particle type, use the same format as `/particle` command
        // `%s` will be replaced with the ID of the block hit
        "particle": "minecraft:block %s",
        // Can be omitted and defaults to `~ ~ ~`
        "position": {
            // In the "absolute" type, the coordinates you specified will be treated as absolute coordinates
            "type": "absolute",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "relative" type, the coordinates you specified will be treated as relative coordinates of the bullet (`~ ~ ~` in commands)
            "type": "relative",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "local" type, the coordinates you specified will be treated as local coordinates of the bullet (`^ ^ ^` in commands)
            "type": "local",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0
        },
        // It doesn't really make sense to use anything other than "absolute" type in here
        // Can be omitted and defaults to `0 0 0`
        "delta": {
            // In the "absolute" type, the coordinates you specified will be treated as absolute coordinates
            "type": "absolute",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "relative" type, the coordinates you specified will be treated as relative coordinates of the bullet (`~ ~ ~` in commands)
            "type": "relative",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "local" type, the coordinates you specified will be treated as local coordinates of the bullet (`^ ^ ^` in commands)
            "type": "local",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0
        },
        // Can be omitted and defaults to 0.0
        "speed": 0.0,
        // Can be omitted and defaults to 1
        "count": 1,
        // Can be omitted and defaults to false
        "force": false
    },
    // Specifies the priority of this particle
    // If multiple particles share the same priority, they are prioritized in this order:
    //   1. Those with both `target` and `blocks` specified
    //   2. Those with only `target` specified
    //   3. Those with only `blocks` specified
    //   4. Those with neither specified
    // Beyond these criteria, the final ordering is undefined and depends on the game's load order
    // Can be omitted and defaults to 0
    "priority": 0
}

Entity Particles

In entity particles, you can make bullets emit particles on different situations.

{
    "type": "entity",
    // Target, see the "Common Types" page
    // Accepts either a single object or a list of objects, and matches if any one of them is valid
    // Can be omitted and it will be used as a fallback, which will be used if no other particles are applicable
    "target": {
        "type": "ammo",
        "values": [
            "tacz:40mm"
        ]
    },
    // Specifies the target entities for this particles, and matches if any one of them is valid
    // Accepts entity ids, entity tags, or any of the "Entity Target" types (see the "Common Types" page)
    // Can be omitted and it will be used as a fallback, which will be used if no other particles are applicable
    "entities": [
        "minecraft:creeper",
        "#minecraft:skeletons",
        {
            "type": "health",
            "unit": "raw",
            "range": {
                "max": 5.0
            }
        }
    ],
    /// All of the following 3 have the same data structure
    // Specifies the particle to emit on the corresponding situation
    // Accepts either a single object or a list of objects
    // Can be omitted and there will be no particle for it
    // Note: If the bullet pierces, the "pierce" particle will be emitted instead of the "hit" particle
    "hit": ...,
    "pierce": ...,
    "kill": {
        // Specifies the particle type, use the same format as `/particle` command
        "particle": "minecraft:block minecraft:redstone_block",
        // Can be omitted and defaults to `~ ~ ~`
        "position": {
            // In the "absolute" type, the coordinates you specified will be treated as absolute coordinates
            "type": "absolute",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "relative" type, the coordinates you specified will be treated as relative coordinates of the bullet (`~ ~ ~` in commands)
            "type": "relative",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "local" type, the coordinates you specified will be treated as local coordinates of the bullet (`^ ^ ^` in commands)
            "type": "local",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0
        },
        // It doesn't really make sense to use anything other than "absolute" type in here
        // Can be omitted and defaults to `0 0 0`
        "delta": {
            // In the "absolute" type, the coordinates you specified will be treated as absolute coordinates
            "type": "absolute",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "relative" type, the coordinates you specified will be treated as relative coordinates of the bullet (`~ ~ ~` in commands)
            "type": "relative",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0,

            // In the "local" type, the coordinates you specified will be treated as local coordinates of the bullet (`^ ^ ^` in commands)
            "type": "local",
            "x": 0.0,
            "y": 0.0,
            "z": 0.0
        },
        // Can be omitted and defaults to 0.0
        "speed": 0.0,
        // Can be omitted and defaults to 1
        "count": 1,
        // Can be omitted and defaults to false
        "force": false
    },
    // Specifies the priority of this particle
    // If multiple particles share the same priority, they are prioritized in this order:
    //   1. Those with both `target` and `entities` specified
    //   2. Those with only `target` specified
    //   3. Those with only `entities` specified
    //   4. Those with neither specified
    // Beyond these criteria, the final ordering is undefined and depends on the game's load order
    // Can be omitted and defaults to 0
    "priority": 0
}
⚠️ **GitHub.com Fallback** ⚠️