Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-235614

Reference to unexisting predicate in a datapack causes java.lang.NullPointerException


    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.19.1 Pre-release 6
    • 1.17.1, 1.18.2
    •  Windows 10, Singleplayer, bundled Java, Vanilla
    • Plausible
    • Crash
    • Very Important

      Referencing an unexisting predicate in an advancement that uses an inventory changed trigger causes a java.lang.NullPointerException upon triggering the advancement.

      How to reproduce:
      Create an advancement with the inventory changed trigger. In the conditions section, add a player[{}] condition. There, add a reference predicate, and set the name to one that doesn't exist. Cause the advancement to trigger by picking up an item. Do not use the /advancement command, as it will not cause a crash. If everything was done correctly, thr game should crash.

      It also doesn't allow the player to join back until either the datapack is disabled, or the reference name is fixed, however, this is inconsistent. Sometimes it is possible to join back after the first or second crash, but eventually it becomes impossible.
      Attached is a datapack which can cause this crash.

            panda4994 [Mojang] Panda
            CSCSCSCSCS wooden_chest
            3 Vote for this issue
            1 Start watching this issue