Skip to content

Model Definition Files

mikeprimm edited this page Nov 26, 2013 · 4 revisions

The model definition file for a mod provides the physical shape of custom blocks, when those physical shapes are something other than a simple solid cube. Consequently, if the custom blocks for a mod only consist of simple solid cubes, a model definition file may not be needed for the mod.

In all cases, the models defined in the model definition file provide a set of surfaces, or patches, that textures defined in the Texture Definition Files are rendered upon. Since the textures are defined separately from the models, models for blocks with common shapes can easily be reused (e.g. the model for a stair block can be the same for any type of stair block, as the differences in how these stairs are rendered are only which textures are applied to the model for each different block).

There are a variety of methods for defining models, ranging from very simple to quite complex (up to and including custom rendering code provided by add-on Java classes). As always, the simpler methods also tend to be the more efficient.

Common lines with Texture Definition Files

In general, the 'modname:', 'version:', 'cfgfile:', 'var:' and other module configuration related lines should be consistent between the Model Definition File and its corresponding Texture Definition File. See Common Features for Texture and Model Definition Files for details on these commonly defined lines. Inconsistencies here can lead to problems with rendering (due to textures being applied without a corresponding model) or loading errors (due to models being used without required textures being supplied).

Defining Models

  • To define a simple cuboid model - a rectangular prism where one or more of the dimensions is less than the size of a full block - see Defining Cuboid Models.
  • To use existing special models - stairs, fences/walls, glass panes/iron fences - see Using Custom Block Models.
  • To define a volumetric model - a shape represented as a 3D grid of smaller cubes - see Defining Volumetric Models.
  • To define patch based models - a collection of arbitrary surfaces to have textures applied - see Defining Patch Models.

Contents

Setup

Advanced Configuration

Mod Support

Developers

Clone this wiki locally