Interface CustomUnbakedBlockStateModel

All Superinterfaces:
BlockStateModel.Unbaked, ResolvableModel
All Known Subinterfaces:
CompositeBlockStateModel.Unbaked

public interface CustomUnbakedBlockStateModel extends BlockStateModel.Unbaked
Allows defining custom unbaked block state model types which can be used within blockstates/ files. It is not necessary to implement this interface when using a custom subclass of BlockStateModel.Unbaked at runtime , e.g. for ModelModifier.

The format for custom unbaked block state models is as follows:


 {
     "fabric:type": "<identifier of the type>",
     // extra model data, dependent on the type
 }
 

The above JSON object may be used in a blockstates/ file wherever a ModelVariant or SimpleBlockStateModel.Unbaked is normally valid. Note that if the "fabric:type" key is present, the object will never be parsed as a ModelVariant, even if the custom type does not exist or is not able to parse the object.

BlockStateModel.Unbaked.CODEC and BlockStateModel.Unbaked.WEIGHTED_CODEC are automatically patched to support custom models. Custom types are encouraged to use BlockStateModel.Unbaked.CODEC to deserialize/serialize submodels.

All types must be registered using register(net.minecraft.util.Identifier, com.mojang.serialization.MapCodec<? extends net.fabricmc.fabric.api.client.model.loading.v1.CustomUnbakedBlockStateModel>) for deserialization/serialization to work.