[SPIGOT-7734] Can't register a custom advancement using unsafe() Created: 09/Jun/24  Updated: 25/Dec/24  Resolved: 09/Jun/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Ben Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: Spigot, bug
Environment:

Windows 11
Local spigot 1.20.6 server
Using maven with intellji


Version: 1.20.6
Guidelines Read: Yes

 Description   

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


Generated at Sat Dec 13 11:46:54 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.