mojira.dev
MC-123032

Tags overwrite, don't append

In the Changelog for Snapshot 17w49b you can read: "When overriding a tag, you now append instead of replacing"

The Bug:

I have two Datapacks installed in my world that each have a tick.json with the filepath: data/minecraft/tags/functions/tick.json
If both datapacks are enabled, only one of them is working. I have to disable the working one to have the other working. This indicates that one overwrites the other. I prepared two test-functions that show the problems (a bit obnoxious):

I have 2 test functions that should spam "Function" and "Function1" into the chat, but only "Function1" is visible in the chat.

Test

Test1

Attachments

Comments 7

The current bug title says "minecraft:tick" but it's any tag-function-group.

More generally, having multiple packs that set "values" to the base pack tag functions does not 'append' the values, as intended, but rather seems to just overwrite them.

So if base:run calls #base:group, and child1 pack adds child1:run to base/tags/functions/group.json's values, and child2 pack adds child2:run to base/tags/functions/group.json's values, I would expect that calling base:run would invoke both child1:run and child2:run, but only the latter is invoked.

My expectation is that each enabled pack 'appends' its values to the tags-group's values (and removes its values from the list if the pack is disabled).

Is this specific to functions, or is it true for other tags too? If you add to `minecraft:wool` block tag, does `minecraft:white_wool` block still detect as a `minecraft:wool`?

I did copy the wool.json over into a testpack, filepath is 'data/minecraft/tags/blocks/wool.json'
The json file looks like this:

{
	"values":	[
		"minecraft:light_blue_wool",
		"minecraft:orange_wool",
		"minecraft:light_gray_wool",
		"minecraft:black_wool",
		"minecraft:gray_wool",
		"minecraft:magenta_wool",
		"minecraft:lime_wool",
		"minecraft:cyan_wool",
		"minecraft:red_wool",
		"minecraft:green_wool",
		"minecraft:white_wool",
		"minecraft:pink_wool",
		"minecraft:purple_wool",
		"minecraft:blue_wool",
		"minecraft:brown_wool",
		"minecraft:yellow_wool",
		"minecraft:bricks",
		"minecraft:stone"
	]
}

Thanks for the Formatting Skylinerw, didn't know how to do that 🙂

I made a 3x3 floor out of white wool and while standing on top I typed a filtered clone in the chat:

/clone ~-1 ~-1 ~-1 ~1 ~-1 ~1 ~-1 ~-1 ~-1 filtered #minecraft:wool force

It found 9 blocks, then I added some bricks and stone, still 9 Blocks, so it works like one would expect.
The same works out of a different pack with data/testing/tags/blocks/wool.json with #testing:wool instead. And that confused my massively because for the tick.json to call the function it has to be in the path: data/minecraft/tags/functions/tick.json but the block tags can be under any namespace inside the data folder?

Created a data pack with data/minecraft/tags/blocks/wool.json defined as:

{
   "values":[
      "prismarine"
   ]
}

When disabled, execute if block ~ ~ ~ #minecraft:wool worked as expected. When enabled, execute if block ~ ~ ~ #minecraft:wool stopped working for wool, and started working for prismarine only.

Therefore I can conclude that yes, this behavior exists and affects all tag types.

Oh, I didn't properly understand the question. This is all so new and confusing to me. I repeated the test from my earlier comment and deleted the wool out of the file. That time, it didn't find any wool, so I can confirm the bug for other tag types as well.

It's fixed, thank you Dinnerbone 😃 👍 👍 👍

This Issue might need to be reopened, not totally sure. It could be I'm just being dumb, but can somebody can have a look in 18w07b if tags overwrite from two different Datapacks? That would be super, thanks.

Elemend

Nathan Adams

Confirmed

datapack, function, tick

Minecraft 17w49b

Minecraft 17w50a

Retrieved