Datapack Basics
A guide to setting up your workspace for Cold Sweat's data system and some important data structures
Cold Sweat has several data systems in place that allow developers or modpack creators more granular control over the mod's config settings. These systems provide advanced functionality that is not accessible through the traditional TOML files.
Workspace Setup
Data files for Cold Sweat are stored in data/<yourmod>/cold_sweat/*
where "yourmod" is the ID of your mod. If you are making a traditional datapack, this can be anything.
So far, there are 4 categories of data: item
, block
, world
, and entity
. Each of these are a dedicated folder within the datapack directory. These directories support using sub-directories for organization.
Data-driven JSON configs can also be put in the mod's config folder in the game directory: config/coldsweat/data/*
. These allow users to use the more advanced JSON system without having to make a datapack.
Notes & Important Constructs
This section contains some miscellaneous information about various aspects of Cold Sweat's config system. Interacting with most of these features is optional.
Required Mods
All JSON configs in Cold Sweat have a "required mods" field that allows for configs to be conditionally loaded depending on what mods are present in the current instance. If any of the required mods aren't met, the config is fully prevented from being parsed, at the first step of the loading process.
This can be useful if the config contains IDs for items, blocks, etc. that belong to a particular mod and thus won't exist if the mod is not present. Not including the proper required mods will allow Minecraft to parse the file, and the missing data will likely cause Minecraft's data loading process to fail entirely.
The format for required mods is very simple:
Required mods can also use a negatable list, allowing conditions to be inverted, meaning the config will only load if a mod is not present:
Negatable List
A negatable list is a collection of requirements and exclusions that can be used in place of most conditional parameters in Cold Sweat. These can be used to define inverted conditions, which pass if the check returns false. Here is the basic format:
For example, here is a negatable list of entity requirements:
For reference, this is what a singular entity requirement would look like in this context:
Fields that support negatable lists will usually be labeled as such, but it is safe to assume that any "requirement" (item, entity, block, etc.) is probably negatable.
Default Configs
Prefixing your own configs with "default" will have the same effect, so it's typically not advisable to do this unless that's your intention. Note that some configs support stacking multiple configs, such as those for insulation. For them, this rule does not apply.
Last updated