Loot Table JSON Serializer not working
TrollTaylor opened this issue ยท 2 comments
I'm trying to deserialize a loot table JSON with this code
reader = new FileReader("piglin_bartering.json");
JsonParser parser = new JsonParser();
JsonElement jsonElement = parser.parse(reader);
GsonBuilder gsonB = new GsonBuilder().registerTypeAdapter(net.minecraft.loot.LootTable.class, new LootTable.Serializer());
Gson gSson = gsonB.create();
LootTable lt = gSson.fromJson(jsonElement, LootTable.class);
It is throwing this error
java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unable to invoke no-args constructor for interface net.minecraft.loot.provider.number.LootNumberProvider. Register an InstanceCreator with Gson for this type may fix this problem.
This area is for bug reports of the fabric api.
It is not a help forum.
Try the discord, or the discussions tab.