Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7734

Can't register a custom advancement using unsafe()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Windows 11
      Local spigot 1.20.6 server
      Using maven with intellji

    • 1.20.6
    • Yes

      I am unable to register a unsafe advancement, below you can see the code i am using:

       

      Bukkit.getUnsafe().loadAdvancement(key, "{\n" +
                      "    \"criteria\": {\n" +
                      "        \"trigger\": {\n" +
                      "            \"trigger\": \"minecraft:impossible\"\n" +
                      "        }\n" +
                      "    },\n" +
                      "    \"display\": {\n" +
                      "        \"icon\": {\n" +
                      "            \"id\": \"minecraft:" + icon + "\"\n" +
                      "        },\n" +
                      "        \"title\": {\n" +
                      "            \"text\": \"" + message.replace("|", "\n") + "\"\n" +
                      "        },\n" +
                      "        \"description\": {\n" +
                      "            \"text\": \"\"\n" +
                      "        },\n" +
                      "        \"background\": \"minecraft:textures/gui/advancements/backgrounds/adventure.png\",\n" +
                      "        \"frame\": \"" + style.toString().toLowerCase() + "\",\n" +
                      "        \"announce_to_chat\": false,\n" +
                      "        \"show_toast\": true,\n" +
                      "        \"hidden\": true\n" +
                      "    },\n" +
                      "    \"requirements\": [\n" +
                      "        [\n" +
                      "            \"trigger\"\n" +
                      "        ]\n" +
                      "    ]\n" +
                      "}"); 

      Although this way of doing it is unsafe, this should still work as intended.

      Below you can see the error i am getting:
      https://imgur.com/a/ioJ8iGA

            Unassigned Unassigned
            BenskiDEV Ben
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: