mojira.dev
MC-295785

Specifying a nonexistent tag in an item definition crashes the game

To Reproduce:

  1. Create a resource pack with an item definition that replaces something vanilla - in my case, I used the Enchantment Book.

  2. Using the component condition, check for something via a tag that doesn’t exist (note that creating the tag in a Datapack will actually prevent this from happening)

  3. The game crashes upon entering a world.

  4. Error: java.lang.UnsupportedOperationException: Tag TagKey[minecraft:enchantment / minecraft:doesnt_exist] can't be dereferenced during construction

Expected:

Either the resource pack wouldn’t load, the item definition wouldn’t load, or it would enter in a “safe mode“ similar to broken definitions in a Datapack.

I could see this being very dangerous, since friends could send packs that crash the game or servers who are configured to send a resource pack may purposefully or accidentally crash their players.

Environment

1.21.5-rc1, Windows 10

Attachments

Comments 1

The resource pack doesn’t seem to crash for me in the latest version of the game. Are you still able to reproduce it in the latest snapshot?

Immodial

(Unassigned)

Plausible

Platform

Important

Crash, Resource Packs

1.21.5 Release Candidate 1

Retrieved