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