Jump to content

[1.15.2] Item Model Texture Missing


Andronomos

Recommended Posts

I'm working on a decorative block mod for my personal use. The blocks will be split into categories. To that end I am trying to organize all my block/item models into sub packages. I'm relatively new to Minecraft modding and java in general but after watching a few tutorials I've managed to get everything working as expected except for one thing: I can't get item models to load when organized into sub packages.

 

In the console I get this error:

Quote

[minecraft/ModelBakery]: Unable to load model: 'blockpalette:metal_1#inventory' referenced from: blockpalette:metal_1#inventory: java.io.FileNotFoundException: blockpalette:models/item/metal_1.json

Now obviously it's telling me it can't find find the model.

 

If I take the item model for metal_1 out of :

models/item/metal/

And just place it into

models/item/

It works as expected.

 

Here is my item model for metal_1. Since it's a block I'm simply setting the parent to the block model. As you can see I'm clearly referencing the metal package in my path.

{
  "parent": "blockpalette:block/metal/metal_1"
}

 

Here's my assets structure (ignore bpglass, its a WIP):
2020-04-16_003748.thumb.png.28dbdeca427f35620a3590589ca8a9b3.png

For testing purposes I'm only trying to get metal_1 to load from a sub package. I will move the rest of the files once I figure a solution.

 

I've watched multiple tutorials and read the Forge documentation but can't find any information on item model pathing. Everyone seems to just put them directly in the item package. I know blockstates can't be put into sub packages, is this true for item models as well? That seems a bit weird that block models can be placed in sub packages but item models cant.

 

 Any help would be appreciated.

Edited by Andronomos
Link to comment
Share on other sites

There is no way to change the location of the Item models as they are loaded the same way blockstates are loaded. The only reason the Block models can be moved into subpackages is that they are only referenced via the blockstate files and Item models are referenced statically.

 

Look at net.minecraft.client.renderer.model.ModelBakery#processLoading to see how it loads the models.

Edited by CHEESEBOT314
Added function that finds the files
Link to comment
Share on other sites

26 minutes ago, CHEESEBOT314 said:

There is no way to change the location of the Item models as they are loaded the same way blockstates are loaded.

Thank you, that was the information I was looking for. The only reason I wasn't 100% sure is because I had asked for help elsewhere and was told my JSON was missing the correct pathing but I couldn't for the life of me see anything wrong with it.

Edited by Andronomos
Fixed grammar
Link to comment
Share on other sites

2 hours ago, Andronomos said:

Thank you, that was the information I was looking for. The only reason I wasn't 100% sure is because I had asked for help elsewhere and was told my JSON was missing the correct pathing but I couldn't for the life of me see anything wrong with it.

If you want your Item's to point to a subpackge the easiest way of accomplishing that is to put it in your registry name IE. new Item(...).setRegistryName("modid", "/folder/filename")

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.

Link to comment
Share on other sites

24 minutes ago, Animefan8888 said:

If you want your Item's to point to a subpackge the easiest way of accomplishing that is to put it in your registry name IE. new Item(...).setRegistryName("modid", "/folder/filename")

Thanks for the info. I looked into that but haven't been successful yet.

 

I'm getting this error:

Exception caught during firing event: Attempted to set registry name with existing registry name! New: blockpalette:metal_1 Old: blockpalette:/metal/metal_1

 

Here's my ItemList class:

public class ItemList
{
    private static Item.Properties ITEM_PROPERTIES = new Item.Properties().group(Blockpalette.BLOCKPALETTE_TAB);

    public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, Reference.MOD_ID);

    //Block Items
    public static final RegistryObject<Item> METAL_1 = ITEMS.register("metal_1", () -> new BlockItem(BlockList.METAL_1.get(), ITEM_PROPERTIES).setRegistryName(Reference.MOD_ID, "/metal/metal_1"));
}

 

I'm assuming I need to call the setRegistryName method before I register the BlockItem but I'm not sure how to do that with a RegistryObject and a DeferredRegister.

Link to comment
Share on other sites

8 minutes ago, Andronomos said:

I'm getting this error:

You're setting the registry name twice.

Here

8 minutes ago, Andronomos said:

ITEMS.register("metal_1"

and here

 

8 minutes ago, Andronomos said:

setRegistryName(Reference.MOD_ID, "/metal/metal_1")

Only do the first one, but change the string.

Edited by Animefan8888
  • Thanks 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.

Link to comment
Share on other sites

4 minutes ago, Animefan8888 said:

You're setting the registry name twice.

I figured as much. I mean the error was pretty self explanatory, I just didn't know exactly how to fix it.

 

4 minutes ago, Animefan8888 said:

Only do the first one, but change the string.

Thanks so much, I had no idea you could include the path in the name. It's working perfectly now.

 

Here I was about to give up thinking it wasn't possible. Now I just need to figure out Data Generators so I can create my models automatically, lol.

 

Offtopic but is there a way to specify the order of Items in the creative menu? I have all my categories of blocks in a single tab and they are all out of order. I assumed the order was based on the order they were registered in.

 

Link to comment
Share on other sites

2 minutes ago, Andronomos said:

Offtopic but is there a way to specify the order of Items in the creative menu? I have all my categories of blocks in a single tab and they are all out of order. I assumed the order was based on the order they were registered in.

I believe they are, but registries are persistent so if you add a block create a world then add another block which is registered before that block it will still appear second.

I'm not a hundred percent sure on if this is the optimal way to do it, but in your own ItemGroup you can override ItemGroup::fill and after getting all of the items in the tab you can sort them.

  • Thanks 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.

Link to comment
Share on other sites

2 minutes ago, Animefan8888 said:

I believe they are, but registries are persistent so if you add a block create a world then add another block which is registered before that block it will still appear second.

Yep, that was the problem. I was using the same world when debugging the mod and I had added new blocks and changed their registry names multiple times. Thanks for all your help!

Link to comment
Share on other sites

1 hour ago, Andronomos said:

Yep, that was the problem. I was using the same world when debugging the mod and I had added new blocks and changed their registry names multiple times. Thanks for all your help!

The problem with that then goes for users too. If they update their mod version and it adds new content the ItemGroup will not be sorted in the correct way. It's better to sort the ItemGroup.

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.

Link to comment
Share on other sites

39 minutes ago, Animefan8888 said:

The problem with that then goes for users too. If they update their mod version and it adds new content the ItemGroup will not be sorted in the correct way. It's better to sort the ItemGroup.

Thanks for the tip, I will look into how to do that.

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Slot deposit 3000 adalah situs slot deposit 3000 via dana yang super gacor dimana para pemain dijamin garansi wd hari ini juga hanya dengan modal receh berupa deposit sebesar 3000 baik via dana, ovo, gopay maupun linkaja untuk para pemain pengguna e-wallet di seluruh Indonesia.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT 3000 ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
    • OLXTOTO: Menikmati Sensasi Bermain Togel dan Slot dengan Aman dan Mengasyikkan Dunia perjudian daring terus berkembang dengan cepat, dan salah satu situs yang telah menonjol dalam pasar adalah OLXTOTO. Sebagai platform resmi untuk permainan togel dan slot, OLXTOTO telah memenangkan kepercayaan banyak pemain dengan menyediakan pengalaman bermain yang aman, adil, dan mengasyikkan. DAFTAR OLXTOTO DISINI <a href="https://imgbb.com/"><img src="https://i.ibb.co/GnjSVpx/daftar1-480x480.webp" alt="daftar1-480x480" border="0" /></a> Keamanan Sebagai Prioritas Utama Salah satu aspek utama yang membuat OLXTOTO begitu menonjol adalah komitmennya terhadap keamanan pemain. Dengan menggunakan teknologi enkripsi terkini, situs ini memastikan bahwa semua informasi pribadi dan keuangan para pemain tetap aman dan terlindungi dari akses yang tidak sah. Beragam Permainan yang Menarik Di OLXTOTO, pemain dapat menemukan beragam permainan yang menarik untuk dinikmati. Mulai dari permainan klasik seperti togel hingga slot modern dengan fitur-fitur inovatif, ada sesuatu untuk setiap selera dan preferensi. Grafik yang memukau dan efek suara yang mengagumkan menambah keseruan setiap putaran. Peluang Menang yang Tinggi Salah satu hal yang paling menarik bagi para pemain adalah peluang menang yang tinggi yang ditawarkan oleh OLXTOTO. Dengan pembayaran yang adil dan peluang yang setara bagi semua pemain, setiap taruhan memberikan kesempatan nyata untuk memenangkan hadiah besar. Layanan Pelanggan yang Responsif Tim layanan pelanggan OLXTOTO siap membantu para pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Dengan layanan yang ramah dan responsif, pemain dapat yakin bahwa mereka akan mendapatkan bantuan yang mereka butuhkan dengan cepat dan efisien. Kesimpulan OLXTOTO telah membuktikan dirinya sebagai salah satu situs terbaik untuk penggemar togel dan slot online. Dengan fokus pada keamanan, beragam permainan yang menarik, peluang menang yang tinggi, dan layanan pelanggan yang luar biasa, tidak mengherankan bahwa situs ini telah menjadi pilihan utama bagi banyak pemain. Jadi, jika Anda mencari pengalaman bermain yang aman, adil, dan mengasyikkan, jangan ragu untuk bergabung dengan OLXTOTO hari ini dan rasakan sensasi kemenangan!
    • Slot deposit dana adalah situs slot deposit dana yang juga menerima dari e-wallet lain seperti deposit via dana, ovo, gopay & linkaja terlengkap saat ini, sehingga para pemain yang tidak memiliki rekening bank lokal bisa tetap bermain slot dan terbantu dengan adanya fitur tersebut.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT DANA ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
    • Slot deposit dana adalah situs slot deposit dana minimal 5000 yang dijamin garansi super gacor dan gampang menang, dimana para pemain yang tidak memiliki rekening bank lokal tetap dalam bermain slot dengan melakukan deposit dana serta e-wallet lainnya seperti ovo, gopay maupun linkaja lengkap. Agar para pecinta slot di seluruh Indonesia tetap dapat menikmati permainan tanpa halangan apapun khususnya metode deposit, dimana ketersediaan cara deposit saat ini yang lebih beragam tentunya sangat membantu para pecinta slot.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT DANA ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
    • Slot deposit pulsa adalah situs slot deposit pulsa tanpa potongan apapun yang dijamin garansi terpercaya, dimana kamu bisa bermain slot dengan melakukan deposit pulsa dan tanpa dikenakan potongan apapun sehingga dana yang masuk ke dalam akun akan 100% utuh. Proses penarikan dana juga dijamin gampang dan tidak sulit sehingga kamu tidak perlu khawatir akan kemenangan yang akan kamu peroleh dengan sangat mudah jika bermain disini.   DAFTAR & LOGIN AKUN PRO SLOT DEPOSIT PULSA TANPA POTONGAN ⭐⭐⭐ KLIK DISINI ⭐⭐⭐  
  • Topics

×
×
  • Create New...

Important Information

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