Item Weights

Item weights are stored as java records. Each record is built at the end of the Loading Phase to capture all known items through the ModFinder.java class.

/**
 * Item weight definitions
 * @param modid String of the mod registering the item
 * @param registryName String form of the item registry name, ex. "cobblestone"
 * @param readableName String form of the item name, ex "Cobblestone"
 * @param weight the {@link Double} value that is returned after generation
 */
public record ItemWeight(String modid, String registryName, String readableName, double weight) {
    
}
TypeNamePurpose
StringmodidThe modid of the mod that owns the item.
StringregistryNameThe registry name of the item.
StringreadableNameThe localized name of the item, server based.
DoubleweightThe weight of the item as a double.

The values from each ItemWeight record are what are initially written to the [modid].json file.