mojira.dev
MCPE-234708

Custom block destruction particles component does not resolve implicit textures correctly

The minecraft:destruction_particles component can be given with only particle_count; it does not require specifying the associated texture for the particles. The implied texture is supposed to correspond to a permutation’s minecraft:material_instances component’s down instance texture. However, this is not the case.

Workaround available

To work around this bug, this component can be redundantly declared in each discriminating permutation body with an explicit texture.

Demonstration

Notice

Both the below demos each show a different block. Both blocks have 2 permutations. The default permutation is shown with the oak planks texture, and the other permutation is shown using the glowstone texture.

Below is a video showing what happens when this component is only declared in the root components object to establish a particle count:

Notice that destruction of the glowstone-textured permutation emits planks particles.

In a related situation where the minecraft:destruction_particles is redefined for the alternative permutation, the texture is not found at all:

In either case, the particles should correspond to the texture of the in-world model.

Reproduction

The wrong texture issue can be seen with the following definition:

{
	"format_version": "1.26.0",
	"minecraft:block": {
		"description": {
			"identifier": "bug_particles:custom_block_with_implied_particles",
			
			"states": {
				"bug_particles:activated": [false, true]
			}
		},
		
		"components": {
			"minecraft:geometry": "minecraft:geometry.full_block",
			"minecraft:material_instances": {"*": {"texture": "planks"}},
			"minecraft:destruction_particles": {"particle_count": 128}
		},
		"permutations": [
			{
				"condition": "q.block_state('bug_particles:activated')",
				"components": {
					"minecraft:geometry": "minecraft:geometry.full_block",
					"minecraft:material_instances": {"*": {"texture": "glowstone"}}
				}
			}
		]
	}
}

The missing texture issue is seen with the following definition:

{
	"format_version": "1.26.0",
	"minecraft:block": {
		"description": {
			"identifier": "bug_particles:custom_block_with_explicit_particles",
			
			"states": {
				"bug_particles:activated": [false, true]
			}
		},
		
		"components": {
			"minecraft:geometry": "minecraft:geometry.full_block",
			"minecraft:material_instances": {"*": {"texture": "planks"}},
			"minecraft:destruction_particles": {"particle_count": 128}
		},
		"permutations": [
			{
				"condition": "q.block_state('bug_particles:activated')",
				"components": {
					"minecraft:geometry": "minecraft:geometry.full_block",
					"minecraft:material_instances": {"*": {"texture": "glowstone"}},
					"minecraft:destruction_particles": {"particle_count": 128}
				}
			}
		]
	}
}

As seen in both these definitions, the code is only trying to convey the desire to establish the particle count without having to redundantly declare the texture atlas key. The first code snippet is the desired form to relate such.

Both examples are taken from the behavior pack in the following world attached for convenience:

[media]

This world can be opened (in Minecraft Preview) for inspection or unzipped to access the code associated with such.

Attachments

Comments 0

No comments.

Ciosciaa

(Unassigned)

Unconfirmed

Multiple

26.0.27 Preview

Retrieved