-
Notifications
You must be signed in to change notification settings - Fork 14
08. Resource Packs
In MiEx very little is hardcoded. Pretty much everything is defined and controllable via files in resource packs. MiEx supports Minecraft Java Edition resource packs, Minecraft Bedrock Edition resource packs, and Hytale resource packs / mods. It uses the files in the same way as the games do. MiEx also defines some additional files that resource packs can contain, to further control how MiEx exports out worlds. This page provides an overview of all of the different files found in resource packs that MiEx uses.
Resource packs are typically located in the resources folder next to the MiEx.jar file, although the location of the folder containing the resource packs can be changed via environment variables or command-line arguments. MiEx only supports resource packs in the form of folders, rather than zip files. If you have a resource pack, addon, behavior pack, data pack, or mod that you want to use that is a zip file, then you would need to unzip it into a folder first.
Block states are files that define blocks. It provides information about the block and most importantly, specifies what models to use for the block and how to combine them. If no block state file exists for a block, then MiEx won't know how to export out that block.
Block states in Minecraft Java Edition resource packs are located in assets/<namespace>/blockstates and the name of the file is the name of the block (minus the namespace). These block state files indicate what models to use for the block and how to modify those models, depending on what the properties of the block are.
Most mods also use these block state files to define their blocks, which allows MiEx to easily be able to support those modded block as well. Some mods do make use of custom formats for their block state files, which MiEx cannot read in. In those cases, you would need to replace it with a version of the block state file that follows the vanilla format.
MiEx does extend the format by adding in a special property that can be checked against called miex_connect_<xOffset>_<yOffset>_<zOffset>, which lets you check what the neighbouring blocks are. This lets you use different models based on what blocks are around it, which helps with implementing block states for modded blocks that use a custom format that MiEx cannot understand. Here's a list of possible values that you can use with this property:
| Syntax | Description |
|---|---|
this |
The block id of the current block. Allows you to check for the same block. |
<Block Name> |
The Minecraft resource identifier for a specific block id. |
<Tag Name> |
The Minecraft resource identifier for a specific tag. It will then match against all blocks specified by that tag. |
!<value> |
Inverts the result of the check against the value. |
<value>|<value> |
Allows you to match against a list of possible values. |
For variant block states, when specifying the properties to match against, MiEx adds in the OR operator with ||. The AND operator is already in there using ,, but you can now also do OR. Do note: OR has the higher priority. It first splits the string against the OR operator and then the AND operator. This is to keep better compatibility with Minecraft Java Edition.
Block states in Minecraft Bedrock Edition resource packs are located in blocks. MiEx follows the same format as Bedrock Edition. Addons use the same format as well and do not make use of custom format, unlike some Java Edition mods, so blocks from addons should always be fully supported.
Block states in Hytale resource packs are located in Server/Item/Items and the name of the file specifies the block name. While Hytale does not make use of namespaces, within MiEx it will always add in the namespace hytale: to block names. MiEx follows the same format as Hytale. Mods use this format as well, so all blocks from mods should be fully supported.
MiEx also has a custom format for specifying block states that can be placed in any kind of resource pack. These blockstates are located in builtins/<namespace>/blockstates. This built-in format provides a much more powerful way of defining blocks. It can use expressions, query neighbouring blocks, and make use of "generators" which allows it to add in the models of blocks, items, entities, and text. MiEx uses this format to define a couple of blocks that otherwise are hardcoded in Minecraft, like beds, chests, end portals, signs, hanging signs, shulker boxes, and skulls.
For more information about how this built-in format works, see the page Built-in Block State Format.
Block models provide the actual geometry for the blocks. They are referenced by the block states. If a block state references a block model that does not exist, then MiEx won't know what that block should look like and won't be able to export that block out.
Block models in Minecraft Java Edition are located in assets/<namespace>/models with the name of the file specifying the model name. MiEx follows the same format as Java Edition.
MiEx also allows for model files to be .obj files rather than Minecraft's .json files. The .obj support is very limited. It only supports quads (triangles are converted into quads) and it also needs to define what textures to use. When it finds a usemtl statement, the name after that should be the resource identifier of the texture to use. All faces defined after that statement will then have that texture assigned to it, until the next usemtl statement. Any faces defined before the first usemtl statement are ignored.
Block models in Minecraft Bedrock Edition resource packs are located in models. MiEx follows the same format as Bedrock Edition.
Block models in Hytale can be located anywhere in the Common folder. MiEx follows the same format as Hytale.
Textures help give blocks their look. They are typically referenced by block models or block states. If a texture is referenced that does not exist, then MiEx will export out a generic grey material. MiEx supports .png, .tga, and .exr textures.
Textures in Minecraft Java Edition are located in assets/<namespace>/textures with the name of the file specifying the texture name.
Textures in Minecraft Bedrock Edition are located in textures. Next to that, textures/terrain_textures.json and textures/item_textures.json is used to map texture names specified in block states to the actual texture files.
Textures in Hytale can be located anywhere in the Common folder.
Textures may be made up of multiple frames stacked on top of each other. MiEx supports these texture animations and material templates can query whether textures are animated like this and set up the materials to make sure that the textures are animated in the export.
Texture animations in Minecraft Java Edition are specified in .mcmeta files located right next to the textures themselves. So fire_0.png would have a fire_0.png.mcmeta file which provides the information about the texture animation. MiEx follows the same format as Java Edition.
Texture animations in Minecraft Bedrock Edition are specified in textures/flipbook_textures.json. MiEx uses the same format as Bedrock Edition.
Hytale currently does not have a system for texture animations similar to Minecraft Java Edition and Minecraft Bedrock Edition. Instead, texture animations are part of block animations.
Blocks may have looping animations on them. MiEx can export these out, where it will export out the animated geometry for one loop and then at every instance of that block place a prim in the USD file that then references the animated geometry and makes it loop for however long it needs to. MiEx can randomly offset these animations per block by specifying the block names in randomAnimationXZOffset and / or randomAnimationYOffset in a miex_config.json file.
Block animations are currently not supported for Minecraft Java Edition as it has no system for specifying this.
Block animations are currently not supported for Minecraft Bedrock Edition as it has no system for specifying this.
Block animations can be located anywhere in the Common folder. MiEx follows the same format as Hytale. If a block state defines CustomModelAnimation for a block and Looping is set to true, then MiEx will load in the block animation specified by CustomModelAnimation.
Some blocks, like item frames in Minecraft, may show items as part of their model. MiEx can export this out.
Items in Minecraft Java Edition are located in assets/<namespace>/items and the name of the file specifies the item name. MiEx uses the same format as Minecraft Java Edition.
MiEx currently does not support items specified in Minecraft Bedrock Edition resource packs.
MiEx currently does not support items specified in Hytale resource packs.
Biomes provide biome colours which are used to tint certain blocks. Which blocks should get which biome colours is specified in miex_block_tints.json. Blocks can either be given a hardcoded tint or be assigned to a "colormap", which allows the tint to vary based on the biome. Colormaps are defined via a resource identifier. Common colormap names are minecraft:grass, minecraft:foliage, minecraft:water, hytale:tint.
Biomes in Minecraft Java Edition are located in data/<namespace>/worldgen/biome and the name of the file specifies the biome name. MiEx uses the same format as Minecraft Java Edition.
Biomes can specify temperature and downfall values which are used to specify where in colormap textures it should pick the biome colour from. Biomes can also specify a hardcoded tint for a biome colour. Hardcoded tints are specified in effects/<name>_color json property, where <name> is the colormap name (if no namespace is defined, it defaults to minecraft: namespace).
Colormap textures are located in assets/<namespace>/textures/colormap, where the name of the texture file is the name of the colormap. Adding in more textures in here will define new colormaps that can be used to tint blocks.
Biomes in Minecraft Bedrock Edition are located in biomes or biomes_client.json. MiEx uses the same format as Minecraft Bedrock Edition.
Biomes can specify temperature and downfall values which are used to specify where in colormap textures it should pick the biome colour from. Biomes can also specify a hardcoded tint for a biome colour. Hardcoded tints are specified in minecraft:biome/minecraft:map_tints/<name> json property, where <name> is the colormap name (if no namespace is defined, it defaults to minecraft: namespace).
Colormap textures are located in textures/colormap, where the name of the texture file is the name of the colormap (with minecraft: namespace added). Adding in more textures in here will define new colormaps that can be used to tint blocks.
Biomes in Hytale are located in Server/Environments, where the name of the file is the name of the biome (with hytale: namespace added). Biome colours are actually specified in the chunk data in Hytale and so that is loaded from there, rather than from the biome. The biome colours from the chunks are put under the hytale:tint colormap. Biomes can still specify hardcoded tints for other colormaps by specifying <name>Tint json property. This is done for the water tint for example. If no namespace is specified, it defaults to minecraft: namespace).
MiEx has limited support for entities. It can export them out as static geometry (typically done for item frames, paintings, and display entities), but it can also do a basic simulation of them and export out animated geometry.
MiEx does not support entities defined in Java Edition resource packs as there is no format to specify entities.
Entities in Minecraft Bedrock Edition are located in entity and entities. MiEx uses the same format as Minecraft Bedrock Edition. The files in entity define the main entity itself and how to export it out. The files in entities define the AI for entities and is used when simulating these entities.
MiEx also supports animations and animation controllers specified in Bedrock Edition resource packs and will use these when simulating entities.
MiEx currently does not support entities defined in Hytale resource packs.
MiEx also has a custom format for specifying entities that can be placed in any kind of resource pack. These entities are located in builtins/<namespace>/entities. MiEx comes with a default implementation for item frame, painting, and display entities that is written using this format. It uses the same format as the built-in format for block states, but with a few small tweaks. Rather than blocks specifying the list of blocks, or uses entities to specify the list of entities that this file handles. And it specifies posX, posY, posZ, rotX, and rotY as top-level properties that can contain an expression to specify the location and orientation of the entity, rather than taking the default values from the entity data.
Whenever blocks or biomes need to be specified, they are specified via their resource identifier. Blocks and biomes can also be grouped under "tags", which lets you easily specify all blocks under that tag rather than having to list out all blocks manually. Tags are used instead of normal block or biome names by using a hashtag: #<name> (defaults to minecraft: namespace if none is provided).
Tags in Minecraft Java Edition are located in data/<namespace>/tags where the name of the file is the name of the tag. MiEx uses the same format as Minecraft Java Edition.
When block states are defined in Bedrock Edition resource packs, if it contains any component whose name is in the format tag:<name> then it will register that block under that tag. This is the same as how it works in Minecraft Bedrock Edition.
When biomes are defined in Bedrock Edition resource packs, if it contains the component minecraft:tags then it will register that biome under the tags specified in there. This is the same as how it works in Minecraft Bedrock Edition.
Blocks in Hytale resource packs can be assigned to a Group, that block is then registered to the tag with the name specified by Group (defaults to hytale: namespace if none is specified).
Minecraft has banners which can have various images painted onto them by combining patterns. Which patterns are available are specified by resource packs.
Banner patterns in Minecraft Java Edition are located in data/<namespace>/banner_pattern and the name of the file is the name of the banner pattern. MiEx uses the same format as Minecraft Java Edition.
MiEx does not support banner patterns specified in Minecraft Bedrock Edition resource packs.
MiEx does not support banner patterns specified in Hytale resource packs.
Minecraft has paintings which can be placed in the world. Which paintings are available are specified by resource packs.
Paintings in Minecraft Java Edition are located in data/<namespace>/painting_variant and the name of the file is the name of the painting. MiEx uses the same format as Minecraft Java Edition.
MiEx does not support paintings specified in Minecraft Bedrock Edition resource packs. The painting textures themselves can be specified in Bedrock Edition resource packs.
MiEx does not support paintings specified in Hytale resource packs.
Some blocks make use of text (for example signs). In order for MiEx to be able to export these out, it needs to have a font definition. Fonts are specified by resource packs.
Fonts in Minecraft Java Edition are located in assets/<namespace>/font and the name of the file is the name of the font. It uses the same format as Minecraft Java Edition.
MiEx does not support fonts specified in Minecraft Bedrock Edition resource packs.
MiEx does not support fonts specified in Hytale resource packs.
MiEx supports atlases, which are large textures that contain other textures. This allows MiEx to output way fewer materials as they have effectively been merged.