[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 |
||
| 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: |