mojira.dev
MC-177253

Running a set_attributes function throws java.lang.NullPointerException if it contains an undefined attribute

The bug

If a set_attributes function contains an undefined attribute, the item stack will try to put null to tag.AttributeName and throws java.lang.NullPointerException.

How to reproduce

  1. /loot give @s loot mc-177253:test

    → ❌ An unexpected error occurred trying to execute that command (java.lang.NullPointerException)

  • data/mc-177253/loot_tables/test.json

    {
      "type": "minecraft:generic",
      "pools": [
        {
          "rolls": 1,
          "entries": [
            {
              "type": "minecraft:item",
              "name": "minecraft:stone",
              "functions": [
                {
                  "function": "minecraft:set_attributes",
                  "modifiers": [
                    {
                      "name": "mc-177253",
                      "attribute": "mc-177253:undefined",
                      "operation": "addition",
                      "amount": 0.0,
                      "slot": "mainhand"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }

Linked issues

Comments 0

No comments.

intsuc

boq

Plausible

Important

Crash

set_attributes

20w14a, 20w15a

20w16a

Retrieved