kotlin
data class IngredientSpec(val id: Identifier, val isTag: Boolean)IngredientSpec.toJson
kotlin
fun toJson(): com.google.gson.JsonElementReturns the JSON representation of this ingredient.
Minecraft 1.21.5+ uses HolderSet<Item> for ingredients, which serializes as:
- Plain item:
"minecraft:diamond"(string primitive) - Tag reference:
"#minecraft:planks"(string primitive with#prefix)
The OLD format {"item": "..."} and {"tag": "..."} is no longer accepted.
