Skip to content

Common JSON Value Types

KnightMiner edited this page Dec 1, 2024 · 27 revisions

This page is in the process of getting migrated to the SlimeKnights Documentation.

Table of Contents

General

These value types are defined either by vanilla Minecraft or by Mantle. Many of them are covered on Mantle's wiki.

ResourceLocation

See the SlimeKnights Documentation.

Ingredient

See the SlimeKnights Documentation.

FluidIngredient

See the SlimeKnights Documentation.

EntityIngredient

See the SlimeKnights Documentation.

SizedIngredient

See the SlimeKnights Documentation.

ItemOutput

See the SlimeKnights Documentation.

FluidStack

See the SlimeKnights Documentation.

Tick

1/20th of a second.

Unique

These value types are defined as part of Tinkers' Construct.

ModifierEntry

Full name and level of a modifier to be added.

Keys

  • name (Modifier): Full modifier name.
  • level (integer): Level of the modifier to be added, defaults to 1.

Example

Represents 1 level of the silky modifier:

{
  "name": "tconstruct:silky"
}

Represents 2 levels of the leaping modifier:

{
  "name": "tconstruct:leaping",
  "level": 2
}

ModifierMatch

Modifier match is a simple way for a recipe to specify the required modifiers. It supports two forms: entry and list

Entry

Same format as ModifierEntry. Represents a single modifier that must be present and the minimum level.

In addition to all the keys specified by the two types, the top level ModifierMatch supports one extra key:

  • error (String): The translation key of the error to shown if the ModifierMatch fails. Only available on the top level.

List

Matches if the required number of items in the matches.

Keys:

  • options (array): List of ModifierMatch objects. Can be either an entry or another list.
  • matches_needed (integer): The amount of matches from the list required.
    • Setting to 0 is effectively a Boolean true
    • Setting to 1 is effectively an OR condition
    • Setting to the size of the list is effectively an AND condition
    • Setting to a value larger than the list size is a Boolean false

Examples

Matches 2 or more levels of the expanded modifier. Errors with the specified key.

{
  "name": "tconstruct:expanded",
  "level": 2,
  "error": "recipe.tconstruct.modifier.ender_expander_requirements"
}

Matches any two of the diamond, emerald, and netherite modifiers:

{
  "options": [
    {
      "name": "tconstruct:diamond",
      "level": 1
    },
    {
      "name": "tconstruct:emerald",
      "level": 1
    },
    {
      "name": "tconstruct:netherite",
      "level": 1
    }
  ],
  "matches_needed": 1,
  "error": "recipe.tconstruct.modifier.gardite_requirements"
}

SlotCount

See the SlimeKnights Documentation.

RandomItem

Represents an item with a random chance and stack size. Can be constant (always returns the given item), range (returns between min and max items), or chance (has a chance percent chance of the result).

Keys

  • All keys from ItemOutput
  • chance (float): Number between 0 and 1 for the percent chance of this item.
  • min (integer): Minimum number of items to produce. Maximum will be the count of the item
  • max (integer): Alias for count as min and max looks cleaner than min and count.
Clone this wiki locally