-
Notifications
You must be signed in to change notification settings - Fork 778
Common JSON Value Types
Table of Contents |
---|
These value types are defined either by vanilla Minecraft or by Mantle. Many of them are covered on Mantle's wiki.
String representing the registry name of an object in the game. Format is always <domain>:<name>
, where <domain>
typically represents a mod or datapack ID, and <name>
is the specific name for this object. Valid characters are any lowercase letter, any number, -
, _
, and /
. A single :
is allowed between the domain and name.
Some JSON specifies resource locations belonging to particular registries:
-
Block: Registry entry in block registry. For example
minecraft:stone
ortconstruct:cobalt_ore
. -
Item: Registry entry in item registry. For example
minecraft:diamond
ortconstruct:iron_reinforcement
.-
IFluidHandlerItem
: Item that contains aIFluidHandlerItem
capability. For exampleminecraft:bucket
ortconstruct:copper_can
. -
IModifiable
: Item that implements theIModifiable
interface giving it a tool definition. For exampletconstruct:axe
-
IMaterialItem
: Item that implements theIMaterialItem
interface, typically a tool part. For exampletconstruct:pickaxe_head
.
-
-
Fluid: Registry entry in fluid registry. For example
minecraft:water
ortconstruct:molten_iron
. -
Modifier: Registry entry in modifier registry. For example
tconstruct:haste
ortconstruct:revitalized
. -
MaterialId: Represents a specific material registered through a datapack. See
data/<domain>/materials/
for material definitions. -
Tag: Tag ID for some registry. For example, the item tag
forge:ingots/copper
or the block tagtconstruct:planklike
.
Vanilla recipe input. See Mantle's wiki for more info. In addition to ingredients defined by vanilla or Mantle, Tinkers' Construct defines several new types of ingredients.
This ingredient serves two purposes: creating an ingredient that matches a material item with a specific material, and creating an ingredient that matches any material for a material item but displays all material variants in JEI.
Keys:
-
type
(string): Alwaystconstruct:material
. -
item
(Item): Item matched by this ingredient. Should be a material item. -
tag
(Item Tag): Makes the ingredient match any item in this tag. -
material
(MaterialId): If set, the ingredient must have this material. If unset any material is valid and the display list will expand to show all material variants.
Mantle fluid ingredient for recipes taking fluids as input. See Mantle's wiki for keys and more info.
Mantle entity ingredient for recipes taking entities as input. See Mantle's wiki for keys and more info.
Mantle ingredient for an ingredient with a minimum size. See Mantle's wiki for keys and more info.
Mantle result for item outputs in recipes. Supports outputting items both from an item name and from a tag using Mantle's preference. See Mantle's wiki for keys and more info.
Represents a fluid as a recipe output. See Mantle's wiki for keys and more info.
1/20th of a second.
These value types are defined as part of Tinkers' Construct.
Full name and level of a modifier to be added.
-
name
(Modifier): Full modifier name. -
level
(integer): Level of the modifier to be added, defaults to 1.
Represents 1 level of the silky modifier:
{
"name": "tconstruct:silky"
}
Represents 2 levels of the leaping modifier:
{
"name": "tconstruct:leaping",
"level": 2
}
Modifier match is a simple way for a recipe to specify the required modifiers. It supports two forms: entry and list
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.
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
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"
}
Contains information about the modifier slots in a recipe. The format for SlotCount
is { "<type>": <slots> }
where <type>
is the type of modifier slots required, and <slots>
is the number of that type needed. At most one type can be specified, if no type is specified the modifier is considered "slotless".
For more information on modifier slots, see Modifier Slot Types
Requires 2 modifier slots of type upgrades
:
"slots": {"upgrades": 2}
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).
- 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 forcount
asmin
andmax
looks cleaner thanmin
andcount
.