mojira.dev
MC-164446

Tags don't load if one of their values is invalid, causing all data packs to unload

The bug

While this may seem intended at first, it is actually inconsistent with function loading and it causes some major problems.

If a function is not recognized while loading, the error is not detected and will be dealt with at runtime, causing that command to be ignored. This is useful because a data pack may rely on another data pack. If that other data pack is not available, we don't want our own data pack to break.

In contrast, if a function tag has an invalid function as one of its values, the whole tag is made invalid. This can cause a chain reaction which can cause other data packs to stop working. Like shown in the attached screenshot, this can also cause all data packs to unload.

How to reproduce

Steps to unload one tag:

  1. Download the "test1.zip" file and place it in the datapacks folder of your world. This is a data pack with one function tag.

  2. Reload the data pack and notice an error in the log

    Couldn't read function tag list minecraft:foo from minecraft:tags/functions/foo.json in data pack test
    com.google.gson.JsonParseException: Unknown value 'minecraft:bar'
    ...

Steps to unload #minecraft:load and break other data packs ⚠️

  1. Download the "test2.zip" file and place it in the datapacks folder of your world. This is a data pack with two function tags. The #minecraft:load tag has one entry #test:foo which itself also has one entry #test:bar. However, this last tag does not exist.

  2. Reload the data pack and notice an error in the log

    Couldn't load function tag test:foo as it either references another tag that doesn't exist, or ultimately references itself
    Couldn't load function tag minecraft:load as it either references another tag that doesn't exist, or ultimately references itself
    Failed to reload data packsjava.util.concurrent.ExecutionException: java.lang.IllegalStateException: Cannot build unresolved tag entry
    ...

    The full error message from the log is available here.

  1. Notice that the vanilla data pack is completely disabled ⚠️ (even though it appears enabled when you run /datapack list). See screenshot-1.png

 

The worst part is that is doesn't tell you in which data pack or function file the error is, so debugging any problems with tags is a pain.

Linked issues

Attachments

Comments 1

Misode

boq

Confirmed

Low

Commands

datapack, tag

1.14.4, 19w42a, 1.15 Pre-release 4, 1.15, 1.15.1, 1.15.1 Pre-release 1

20w14a

Retrieved