Skip to content
On this page
Common

Recipes

top.katton.api.datapackcommon/src/main/kotlin/top/katton/api/datapack/Recipes.kt
Generated from Kotlin KDoc in `common/src/main/kotlin/top/katton/api/datapack/Recipes.kt`.

IngredientSpec

IngredientSpecCommonData Class
kotlin
data class IngredientSpec(val id: Identifier, val isTag: Boolean)

IngredientSpec.toJson

IngredientSpec.toJsonCommonFunction
kotlin
fun toJson(): com.google.gson.JsonElement

Returns 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.