Skip to content

Instantly share code, notes, and snippets.

@pupnewfster
Forked from williewillus/grammar.js
Last active February 5, 2025 23:05
Show Gist options
  • Save pupnewfster/7b5c411635e16227c1dea9af5e20e4c3 to your computer and use it in GitHub Desktop.
Save pupnewfster/7b5c411635e16227c1dea9af5e20e4c3 to your computer and use it in GitHub Desktop.
ProjectE Custom Conversion JSON Grammar
{
"comment": <Optional comment describing the file>,
"replace" <bool> // Optional defaults to false. If true overrides any previously loaded conversions with the same file path
"groups": { //Optional
"<name>": <group>, ...
},
"values": { //Optional
"before": <valuemap>, //Optional
"after": <valuemap>, //Optional
"conversion": [ <conversion>, ... ] //Optional
}
}
-----------
<valuemap> ::= [
{
<nss>, //Flattended NSS representation (the curly braces from the definitions of <nss> are already here, and the amount field is just added within them)
"emc_value": <value>,
},
...
]
<group> ::= {
"comment": <Optional comment>,
"conversions": [ <conversion>, ... ]
}
<conversion> ::= {
"output": <nss>,
"count": <int> // If left out, defaults to 1. Must be greater than zero
"ingredients": [
{
<nss>, //Flattended NSS representation (the curly braces from the definitions of <nss> are already here, and the amount field is just added within them)
"amount": <int> // Defaults to 1, may not be zero. If the same ingredient is listed multiple times in ingredients, the values will be summed
},
...
],
"propagateTags": <bool> // If true and the output is a tag, this conversion will be propagated to all elements in the tag matching the tag name, defaults to false
}
<value> ::=
<long> // Must be greater than zero
"free" // Marks this ingredient as "free" to the mapper, which means it does not contribute to the final cost of the output
<data> ::= {
"<component_type>": <component_representation>, //See https://minecraft.wiki/w/Data_component_format for how to represent components or their removal
...
}
<nss> ::= { // Represents an Item
"type": "projecte:item",
"id": "<modid>:<registryName>", //The item's registry name
"data": <data> //Optional data component data to be specified if this NSS requires the data as part of its representation
}
<nss> ::= { // Reference an item tag ID
"type": "projecte:item",
"tag": "<domain>:<name>" //Tag Key of the item tag
}
<nss> ::= { // Represents a fluid
"type": "projecte:fluid",
"id": "<modid>:<registryName>", //The fluid's registry name
"data": <data> //Optional data component data to be specified if this NSS requires the data as part of its representation
}
<nss> ::= { // Reference a fluid tag ID
"type": "projecte:fluid",
"tag": "<domain>:<name>" //Tag Key of the fluid tag
}
<nss> ::= { // Create a fake stack used only in this file (unless the namespace is explicitly specified)
"type": "projecte:fake",
"namespace": "<domain>", //Optional. If present, forces this fake stack to use another file's domain instead of its own
"description": "<name>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment