Expand description
.yblock / .yitem content files — a mod’s blocks and items: their
properties, 3D model, block states and item form, in one JSON file each,
edited in Yog-IDLE’s 3D model editor. See Yog-IDLE’s
docs/blocks-items.md for the format.
yog build reads content/**/*.yblock and content/**/*.yitem and
- writes Minecraft’s JSON for them: block models, blockstates, item
models, 1.21.4+ item definitions (
assets/<ns>/items/), block loot tables, themineable/<tool>andneeds_<level>_toolblock tags; - puts their names and tooltips into the lang files (a
@<Set>.<name>text of a.yresfile under the key Minecraft looks up, a literal intoen_us); - bundles textures given as paths inside
resources/; - generates
.yog-build/generated/yog-content.g.rs—Blocks/Itemswith an id constant and aBlockDef/ItemDefbuilder per entry and aregisterfunction — pulled in byyog_api::content!();, which also registers them (unless an entry says"register": "manual").
Modules§
- json
- A small JSON reader that remembers the line of every value, so
.yblockand.yitemerrors point atfile:line(serde_json only knows where a syntax error is).
Structs§
- Compiled
- Everything
yog buildmakes of a mod’s content files. - Output
Set - Outputs in order, keyed by path:
OutputSet::putreplaces a path’s output (moving it to the end) without rescanning the list. - Template
- A model template —
"parent": "cube_all"— and the texture slots it takes.
Enums§
- Kind
- What a content file defines.
Constants§
- CONTENT_
DIR - Where content files live, under the mod root.
- DIRECTIONS
- DISPLAY_
SLOTS - GENERATED_
FILE - The generated Rust code, under the mod root.
- RENDER_
LAYERS - SOUNDS
- The sound groups the loaders map (
BlockDef::sound). - TEMPLATES
- TOOLS
- TOOL_
LEVELS
Functions§
- compile
- Compiles the mod’s content files (see the module docs). Any error fails the whole thing, listing every problem.
- find
- Every
content/**/*.yblock|*.yitemof the mod atroot, sorted. - import_
command yog import ...(args afterimport).- merge_
outputs - Adds the content’s outputs to
outputs(the.yresones, say): lang entries and tags merged into what’s there (or into the mod’s own files), the rest appended. - template
- valid_
id ns:path(orpath, inminecraft) as a valid resource id.- valid_
namespace [a-z0-9_.-]+— a Minecraft namespace.- valid_
path [a-z0-9_./-]+— a Minecraft resource path.- write_
source - Writes
compiled.sourcetoGENERATED_FILE(only when it changed); deletes it when the mod has no content files.
Type Aliases§
- Output
- A generated file: path inside the
.yogand its bytes.