-
Notifications
You must be signed in to change notification settings - Fork 7
Element JSON Format [1.3]
This format will be added in Version 1.3 and will not work in any previous versions. The information on this page is preliminary and could be subject to change.
The Element recipe type is used for the alloying system of the mod.
name: String. Must be defined. Directly defines the name of the element.
symbol: String. Must be defined. Defines the element's symbol, which typically is a length of one or two letters.
color: Integer, set to 16777215 (white) by default. Defines the element's color, which is used for custom alloys.
atomic: Integer. Must be defined. Defines the element's atomic number.
potential: Float, set to 0 by default.
items: JSON Array (string). The format is the following:
- For single items, use the string "I#" before the resource location. (ex. "I#minecraft:netherite_scrap").
- For tags, use the string "T#" before the string used for the tag. (ex. "T#forge:ingots/copper").
values: JSON Array (int). Determines the material count for the members of the items array. Therefore, the size of the two arrays should be consistent.
toolenchantment: String. Points to a resource location for a tool enchantment.
toolenchantmentmin: Int (0-100). Determines what percentage is necessary in order for the tool enchantment to apply.
armorenchantment: String. Points to a resource location for an armor enchantment.
armorenchantmentmin: Int (0-100). Determines what percentage is necessary in order for the tool enchantment to apply.
arrowType: String. More information will come at a later time.
arrowtypemin: Int (0-100). Determines what percentage is necessary in order for the arrow type to apply.
Following these variables begin the stat JSON objects. There are two types of stats: Additive and Min/Max.
- Additive stats combine together (Element1 stat + Element2 stat + Element3 stat).
- Min/Max stats will take the highest and lowest value from the combination of elements and perform (Max + Min) for the final stat result in the alloy. (Min can only be 0 or a negative number as both min and max are set to 0 by default).
All of these stats act as JSON objects, with the string in quotations below acting as the variable name. The following stats can be defined in an element:
- "durability" - Determines the durability added with other elements to the alloy. Additive.
- "miningspeed" - Determines the mining speed added with other elements to the alloy. Additive.
- "mininglevel" - Determines the harvest level of this particular element. Min/Max.
- "enchantability" - Determines the enchantibility added with other elements to the alloy. Additive.
- "damage" - Determines the damage of this particular element. Min/Max.
- "attackspeed" - Determines the attack speed of this particular element. Min/Max.
- "corrosionresist" - Determines the corrosion resistance added with other elements to the alloy. Additive.
- "heatresist" - Determines the heat resistance added with other elements to the alloy. Additive.
- "knockbackresist" - Determines the knockback resistance added with other elements to the alloy. Additive.
- "toughness" - Determines the toughness added with other elements to the alloy. Additive.
All of the following are JSON Arrays and within each stat should be the same size. All variables must be defined for each increase of size in any array.
breaks: Integer JSON Array. Determines where the current stat formula stops (less than or equal to).
formulas: String JSON Array. Only specific arguments can be used in this variable which determine the format of the formula used for other variables. Below are the possible arguments (where x is the percentage, and a and b are variables defined below).
-
"LINEAR": (a*x + b)
-
"POWER": (x^a + b)
-
"EXPONENTIAL": (a^x + b)
-
"LOGARITHMIC": (aln(x) + b)
Uses the log function with a base of e.
- "LOG10": (alog10(x) + b)
Uses the log function with a base of 10.
- "CONSTANT": (a)
Uses a constant using variable a and ignores the values of x and b.
a: Float JSON Array. Determines the value of variable "a" in the formula. See above.
b: Float JSON Array. Determines the value of variable "b" in the formula. See above.
modifiers: String JSON Array. Only specific arguments can be used in this variable which can be used to make more complex formulas. Below are the possible arguments (where f is the output of the formula and limit is the variable defined below).
- "NONE": (f)
Returns the value of f with no modification.
- "ABSOLUTE_VALUE": (abs(f))
Returns the value of f ignoring negatives.
- "CEILING": (ceil(f))
Returns the value of f rounded down to the nearest integer.
- "FLOOR": (floor(f))
Returns the value of f rounded up to the nearest integer.
- "MAX": (max(f,limit))
Returns the greatest of the two values, f and limit.
- "MIN": (min(f,limit))
Returns the lowest of the two values, f and limit.
- "ADDITION": (extra = limit)
Adds an optional addition/subtraction to the variable of x in the original formula. (ex. (alog10(x+extra) + b))
- "MULTIPLIER": (extra = limit)
Adds an optional multiplier/divisor to the variable of x in the original formula. (ex. (a^(x*extra) + b))
limit: Float JSON Array. Used for modifier formulas. See above.