BabylonJS/Babylon.js · error
${extraContext}: Material type not supported
Error message
${extraContext}: Material type not supported What it means
MSFT_minecraftMesh requires the loader to have created a PBR material implementation, since it applies its extra properties on top of the 'pbr' metal-rough workflow. loadMaterialPropertiesAsync looks up _loader._pbrMaterialImpls.get('pbr'); if the material is not a PBR metallic-roughness material (or the PBR implementation wasn't registered), it throws.
Source
Thrown at packages/dev/loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.pure.ts:40
/** @internal */
constructor(loader: GLTFLoader) {
this._loader = loader;
this.enabled = this._loader.isExtensionUsed(NAME);
}
/** @internal */
public dispose() {
(this._loader as any) = null;
}
/** @internal */
// eslint-disable-next-line no-restricted-syntax
public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
return GLTFLoader.LoadExtraAsync<boolean>(context, material, this.name, async (extraContext, extra) => {
if (extra) {
const impl = this._loader._pbrMaterialImpls.get("pbr");
if (!impl) {
throw new Error(`${extraContext}: Material type not supported`);
}
const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);
if (babylonMaterial.needAlphaBlending()) {
babylonMaterial.forceDepthWrite = true;
babylonMaterial.separateCullingPass = true;
}
babylonMaterial.backFaceCulling = babylonMaterial.forceDepthWrite;
(babylonMaterial as PBRMaterial).twoSidedLighting = true;
return await promise;
}
});
}
}
View on GitHub (pinned to 0592b347b8)
Solutions
- Ensure materials with MSFT_minecraft_mesh use the pbrMetallicRoughness workflow.
- Remove the MSFT_minecraft_mesh extension from non-PBR materials.
- Re-export the asset converting unlit/spec-gloss materials to metallic-roughness.
Example fix
// before: unlit material with the extension
"materials": [{ "extensions": { "MSFT_minecraft_mesh": {} }, "KHR_materials_unlit": {} }]
// after: PBR material keeps the extension
"materials": [{ "extensions": { "MSFT_minecraft_mesh": {} }, "pbrMetallicRoughness": { "baseColorFactor": [1,1,1,1] } }] Defensive patterns
Strategy: type-guard
Validate before calling
const isPbr = material.defs?.some(d => d.name === 'pbrMetallicRoughness') || !material.extensions?.KHR_materials_unlit;
if (!isPbr) throw new Error('MSFT_minecraft_mesh requires PBR metallic-roughness materials'); Type guard
function isPbrMaterial(m: IMaterial): boolean {
return !m.extensions?.['KHR_materials_unlit'] && !m.extensions?.['KHR_materials_pbrSpecularGlossiness'] && 'pbrMetallicRoughness' in m;
} Try / catch
try { await loader.loadAsync(url); } catch (e) {
if (e.message.includes('Material type not supported')) {
// convert the material to metallic-roughness or strip the extension, then retry
} else throw e;
} Prevention
- Pair MSFT_minecraft_mesh only with pbrMetallicRoughness materials.
- Audit material/extension combinations when converting assets between workflows.
- Prefer checking the material definition before load rather than catching at runtime.
When it happens
Trigger: Loading a glTF where a material carries the MSFT_minecraftMesh extra but the material is not PBR metallic-roughness — e.g. it uses KHR_materials_unlit, spec-gloss (KHR_materials_pbrSpecularGlossiness), or another workflow.
Common situations: Assets mixing MSFT_minecraft_mesh with unlit or legacy specular-glossiness materials; converting assets between workflows and keeping the extension; custom loaders that don't populate the PBR implementation map.
Related errors
- No PBR material implementation loaded
- Cannot get the last selected variant on a glTF mesh that doe
- nodeIndex not found in configuration
- nodeIndex not found in configuration
- ${extensionContext}: Texture type not supported
AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30).
Data as JSON: /api/errors/3057c117f2bf3687.
Report an issue: GitHub.