Sunday 24 May 2015

Symptoms of Block and Item model errors [1.8-11.14.1.1441 and higher]


If you haven't already, read this introduction first.

Texture errors

Missing texture errors have been significantly changed in 1441 and higher.  You now get a summary of any texture errors that looks like this

[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN missingtextures
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:   domain missingtextures is missing 2 textures
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:     domain missingtextures has 1 location:
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:       mod missingtextures resources at C:\Users\TGG\Documents\mods\test-1441\mods\missingtextures_build_gradle-1.0_build_gradle.jar
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain missingtextures are:
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/blocks/mt_block_texture_wrong.png
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/mt_item_texture_wrong.png
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:     The following other errors were reported for domain missingtextures:
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:     Problem: broken aspect ratio and not an animation
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/blocks/mt_block_texture_malformed.png
[10:07:19] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================


  1. The domain here should match your modid.  If it doesn't, one of your files has a wrong domain name - MT18 here for blocks, MT69 here for items.  If the domain says "minecraft", you have forgotten the domain name - MT19 here for blocks, MT70 here for items.
  2. The resource location shows where Forge was looking for your mod's resources.  If this is not right, your build environment has a problem or your resources folder structure is not right, or (for older Forge versions) you are using IntelliJ 14 and haven't added
    sourceSets { main { output.resourcesDir = output.classesDir } }
    to the bottom of your build.gradle file.
    In all three cases, see here for more information.
  3. For missing resources each of the filenames is either in the wrong place, or you misspelled the filename in your block model file (see MT17 here) or item model file (see MT68 here).
  4. Make sure your 'resources' tree is marked as a source folder. If it is not, it won't be included in the build when you try to test in the dev environment, and ALL your textures and JSONs will be missing.
  5. A broken aspect ratio message - your texture needs to have the same width and height (aspect ratio = 1).
A useful breakpoint for texture errors is here
TextureMap::
public void loadTextureAtlas(IResourceManager resourceManager)
{
...
catch (IOException ioexception)
catch (RuntimeException runtimeexception)
catch (IOException ioexception1)
}
and for older Forge versions
FMLClientHandler::
public void logMissingTextureErrors()
{
    if (missingTextures.isEmpty() && brokenTextures.isEmpty())
    {
        return;
    }
// breakpoint on the following line
    Logger logger = LogManager.getLogger("TEXTURE ERRORS");
    logger.error(Strings.repeat("+=", 25));
    logger.error("The following texture errors were found.");

Other errors

If missing texture errors aren't the problem, look in the error console for messages which mention your block or item's name, eg messages like this:
 [Client thread/ERROR] [FML]: Exception loading model yourmodid:block/my_block_model with loader instance, skipping

Did you find any?  If so, hunt through the list of error message below until you find the one which best matches your symptom, then check the list of common mistakes for that error.

Otherwise, unfortunately you have made one of the many possible mistakes which produce no error messages in version 1441.  I can only suggest you look through the list of common mistakes one by one to see if you have made any of them.  Failing that, ask your question at the forum...  and when you've solved it, post me a comment to tell me what the problem was...

Console Error Messages


 [Client thread/ERROR] [FML]: Exception loading model missingtextures:block/mt14_block_model with loader instance, skipping.
com.google.gson.JsonParseException: BlockModel requires either elements or parent, found neither

Parent tag in your block or item model is missing, see MT14, MT15 and MT60 here.

[Client thread/ERROR] [FML]: Exception loading model missingtextures:block/mt15_block_model with loader instance, skipping
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 3 column 6

One of your json files, probably the block or item model, has a syntax error in it, at the given line and column.  This site can help you fix it http://jsonlint.com/.

[10:08:53] [Client thread/WARN]: Unable to load definition missingtextures:mt10_blockname#normal
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 3 column 6
One of your json files, probably the blockstates file, has a syntax error in it, at the given line and column.  This site can help you fix it http://jsonlint.com/.

 [Client thread/WARN]: Unable to resolve texture due to upward reference: #all in minecraft:models/block/cube_all
One of your block models, which has cube_all as a parent, didn't define the expected texture #all
see MT13, MT16 here

 [Client thread/ERROR] [FML]: Model definition for location missingtextures:mt61_blockname#normal not found
For blocks:
  a blockstates file problem, see MT02, MT07  here
  or see MT05, MT08 here.
For items:
an item model problem, see MT60, MT61, M62, MT63, MT64, MT65 here

 [Client thread/ERROR] [FML]: Model definition for location missingtextures:mt60_blockname#inventory not found
for blocks a blockstates problem, see MT02  here
for items an itemmodel problem, see MT60, MT64 here




10 comments:

  1. For the last error (Model definition for location missingtextures:mt60_blockname#inventory not found) you refer to MT60 and MT64, but I can't see anything labelled MT60 or MT64 in the linked post.

    ReplyDelete
  2. Ah yeah, you're right, the link should be http://greyminecraftcoder.blogspot.com.au/2015/05/common-mistakes-in-block-models.html, thanks!

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. EDIT Fixed. You have Great Guides for learning mods, thanks!

      Delete
  4. On me it says:
    20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: DOMAIN minecraft
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: domain minecraft is missing 1 texture
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: domain minecraft has 3 locations:
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: unknown resourcepack type net.minecraft.client.resources.DefaultResourcePack : Default
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: mod FML resources at C:\Users\Vinski\.gradle\caches\minecraft\net\minecraftforge\forge\1.9.4-12.17.0.1963\snapshot\20160518\forgeSrc-1.9.4-12.17.0.1963.jar
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: mod Forge resources at C:\Users\Vinski\.gradle\caches\minecraft\net\minecraftforge\forge\1.9.4-12.17.0.1963\snapshot\20160518\forgeSrc-1.9.4-12.17.0.1963.jar
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: The missing resources for domain minecraft are:
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: textures/vfm.items/hamburger.png
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: No other errors exist for domain minecraft
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
    [20:34:09] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

    ReplyDelete
  5. Hi
    If the domain says "minecraft", you have forgotten the domain name. For example
    "textures":{
    "layer0":"items/hamburger.png"

    should be
    "textures":{
    "layer0":"yourmodid:items/hamburger.png"

    -TGG

    ReplyDelete
  6. I fixed the aspect ratio, but I still get the "broken aspect ratio and not an animation" message. Could it be the animation part? I did not put in any code for an animated texture, and I had done it the same way for all of my other textures, that work.
    Note: It was not the texture file, I tried to replace it with a few other models, and it said the same thing.

    ReplyDelete
    Replies
    1. Hi. Not sure about that one. You could try setting a breakpoint at that error message (In 1.10.2 this is at TextureAtlasSprite.loadSprite()) and seeing what is wrong with your texture.
      public void loadSprite(PngSizeInfo sizeInfo, boolean p_188538_2_) throws IOException
      {
      this.resetSprite();
      this.width = sizeInfo.pngWidth;
      this.height = sizeInfo.pngHeight;

      if (p_188538_2_)
      {
      this.height = this.width;
      }
      else if (sizeInfo.pngHeight != sizeInfo.pngWidth)
      {
      throw new RuntimeException("broken aspect ratio and not an animation");
      }
      }
      -TGG

      Delete