Jump to content

Item Generated by ItemBlock's Model Does Not Render


Recommended Posts

Posted

I know, this is one of the common issues, but I couldn't manage to show models on the item. Item's model is a huge cube without texture, while block has the correct model and texture.

blockstate:

Spoiler

{
  "forge_marker": 1,
  "defaults": {
    "model": "anodysseyforthegoldenkey:bookshelf",
    "textures": { "texture": "blocks/planks_oak"}
  },
  "variants": {
    "facing": {
      "north": {},
      "east": {"y": 90},
      "south": {"y":180},
      "west": {"y":270}
    }
  }
}

 

 


assets:

Spoiler

image.png.4ca38d2ab94f8eb3dd05d21c5a99e713.png

 


I tried adding "inventory" variant with "model" and copying "models/block/bookshelf" to "models/item" both without renaming and renaming it to" bookshelf_oak", but couldn't manage to get it to work. I remember something like "generated" item texture, but I don't remember where I read it and I don't know it is required or not. So, what is the correct way to load items' textures from blockstates, if possible? If not, do I have to create separate models for each with different displays? Thanks in advance.
 

Posted
30 minutes ago, Belial said:

Item's model is a huge cube without texture,

do you mean a Missing Model?

did you register a model for your item (in your code)?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
33 minutes ago, Belial said:

I tried adding "inventory" variant

Post this blockstate, and show your log as well as where you register your ItemBlock models.

  • Like 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
2 minutes ago, Cadiboo said:

do you mean a Missing Model?

did you register a model for your item (in your code)?

Yes, I meant missing model. No, I didn't register model for the item, but it's itemblock. Isn't itemblock supposed to take block's model? It does for normal cubic blocks.

Posted
Just now, Belial said:

Yes, I meant missing model. No, I didn't register model for the item, but it's itemblock. Isn't itemblock supposed to take block's model? It does for normal cubic blocks.

No, all items need you to register their models in code.

 

  • Like 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted (edited)
21 minutes ago, Animefan8888 said:

Post this blockstate, and show your log as well as where you register your ItemBlock models.


Nothing different, but here it is (blockstate). I tried both of these (I did create "bookshelf_oak.json" for the first one):

 

Spoiler

{
  "forge_marker": 1,
  "defaults": {
    "model": "anodysseyforthegoldenkey:bookshelf",
    "textures": { "texture": "blocks/planks_oak"}
  },
  "variants": {
    "inventory": [{"model":"anodysseyforthegoldenkey:bookshelf_oak"}],
    "facing": {
      "north": {},
      "east": {"y": 90},
      "south": {"y":180},
      "west": {"y":270}
    }
  }
}

 

 
 
 


 

Spoiler

{
  "forge_marker": 1,
  "defaults": {
    "model": "anodysseyforthegoldenkey:bookshelf",
    "textures": { "texture": "blocks/planks_oak"}
  },
  "variants": {
    "inventory": [{"model": "anodysseyforthegoldenkey:bookshelf"}],
    "facing": {
      "north": {},
      "east": {"y": 90},
      "south": {"y":180},
      "west": {"y":270}
    }
  }
}

 

 


Here is the error related to only one block: https://wastebin.party/imuvevojun

Also, when the "inventory" part is added, it does not give any errors, but nothing changes.

And, I didn't register any model for itemblock. As normal cubic blocks' itemblock can take it without registering anything, I expected the same. If I have to register it with "ModelLoader.setCustomModelResourceLocation", then that is the issue.

EDIT: Apperantly, I figured out that I recall wrong. It does not take the model for any block without registering a custom model resource location. I thank you all.

Edited by Belial

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.