mojira.dev
MC-295914

Loot table files accept invalid JSON

Loot table JSON files, and perhaps other files as well (untested), accept malformed JSON.

I have attached a data pack that reproduces this bug. The data pack contains these two loot table files:

valid.json

{
  "pools": [
    {
      "entries": [
        {
          "type": "item",
          "name": "minecraft:light_gray_dye"
        }
      ],
      "rolls": 1
    }
  ]
}

invalid.json

{
  "pools": [
    {
      entries: [
        {
          type: item,
          "name": "minecraft:light_gray_dye"
        }
      ],
      "rolls": 1
    }
  ]
}

In game, both of these loot tables are loaded without any errors, and can be used in-game (see attached screenshot), despite invalid.json missing quotes around the entries and type keys, as well as the item string.

Environment

Windows 10

Attachments

Comments 0

No comments.

Ellivers

boq

Confirmed

Platform

Low

Data Packs

1.21.5

25w18a

Retrieved