-
Notifications
You must be signed in to change notification settings - Fork 56
Resource Helpers
MehVahdJukaar edited this page Jul 25, 2026
·
1 revision
The odds and ends used when generating or reading resources.
Mostly companions to Runtime Resource Packs, but they work on their own too.
| Class | |
|---|---|
StaticResource |
A resource read once and kept around, so you can transform it repeatedly without hitting the resource manager again. StaticResource.getOrThrow(manager, path)
|
ResType |
The resource kinds (block models, item models, blockstates, textures, tags, recipes...) with their folders and extensions, so you don't hand-build paths |
RPUtils |
Digging things out of the loaded packs: find a block's or item's first texture, find resource references inside a json recursively, read and write recipes, make a similar recipe for another block type |
LangBuilder |
Build a lang file in code. Also has getReadableName, which turns some_block_name into Some Block Name
|
SimpleModelBuilder |
Build a block or item model json without writing json |
SimpleTagBuilder |
Build a tag json, including appending to an existing tag |
RecipeTemplate / RecipeConverter
|
Take an existing recipe and produce a variant of it |
BlockTypeResTransformer |
The heavy one: takes a resource and rewrites it for another block type, replacing ids, textures and paths. This is what turns one oak model into a model for every wood |
BlockTypeSwapIngredient |
An ingredient that matches the equivalent item of another block type |
McMetaFile |
Read and write .mcmeta, mostly for animated textures |
StaticResource oakModel = StaticResource.getOrThrow(manager,
ResourceLocation.parse("models/block/oak_shelf.json"));
// one transformer, applied to every wood type: rewrites ids and textures from "oak" to the target
var transformer = BlockTypeResTransformer.wood(MyMod.MOD_ID, manager)
.IDReplaceType("oak")
.replaceBlockType("oak")
.replaceWithTextureFromChild("minecraft:block/oak_planks", "planks");See the Runtime Resource Packs page for how these get used in a generator.
Basics Platform Helpers Registration Networking Events Configs Config Screen
Resources Runtime Resource Packs Texture Manipulation Resource Helpers Block Set API
Client Custom Models Item Rendering Rendered Textures Post Shaders GUI Toolkit Colors
World Block and Item Interfaces Additional Item Placements Improved Entities Fake Levels World Data Dispenser Behaviors
Utilities Codec Utilities Misc Helpers Commands
Datapacks Villagers Soft Fluids Map Markers Spawn Boxes Global Datapack Folder