Started by
hacker_303
on
Topic category: Help with Minecraft modding (Java Edition)
Hi! I'm looking for a way to make an item that shows the 3D model in the main hand, but displays the 16x16 texture in the inventory, like the trident. I'm using Geckolib. Thanks in advance.
Edited by hacker_303 on Fri, 08/02/2024 - 06:47
Actually, if you do it at a full 90° angle, it will appear in 2D. But if you are looking for a different way, I can't help you, I'm new too.
Thank you Pandabeys31 for the advice but even doing it as you say the animations are still visible :/
fr6_17, can you explain your code to me: what are the parts to replace or change and with what?
Lock your item, open the item.json file and paste in the code above. Then replace the custom/...etc with the names of your textures and models. The custom/model will be the geckolib model, the item/model_texture will be the geckolib model texture for in hand. The item/item_texture will be the texture of the item in the inventory/gui. Also dont include .png at the end of these names, only the actual name is required. E.g. if your file is: [ sword_texture.png , then use item/sword_texture ], same for the model.
This works with any custom model and should work with a geckolib model, I have used it with geckolib and it has worked. Idk if theres been any changes since then, it would depend on your version of mcreator.
Hey fr6_17 somehow its not working for me.
Well the last 3 "parent"s should be "parent": "item/generated". Like I put in the code above. Also you have the same texture for all of them, makes no sense. You should have 2 different textures, one being the 2d 16x16 in inventory texture. Which you put into the last 3 "layer0"s. The other texture is the geckolib model texture which you put in the first "layer0". All you have to do it copy paste the code above and replace mod_id with roulette etc:
^Like this if your gui texture was called (revolved_gui_texture.png) for example.
Also if your using forge its obviously not gonna work, just replace neoforge with forge in the "loader".
Can you help me with another question?
I am trying to do an Item animation but if i am holding the item and having another one in my hotbar (or dropped or in itemframe etc..) every item will do the animation.
The console says that the model isnt working somehow i mean its a geckolib model but it should work either right?
Well idk what your doing, your code above is wrong so if your using that then obviously its not gonna work. The code for my geckolib item is slightly different to the one i put a while ago.
It would be this for a generic item:
Also you may need to open the model.java file and change or add some code. Mine looks like this:
I cant really remember how I made it work but it does work. If it still doesnt work after using the same code you can try crawling through the code and amending the textures for when in gui and inventory to be the specified version rather than always using the model texture by default.
Hey fr6_17, your code works really well :) However, I replaced Neoforge because my mod is Forge. My next step is to make the texture of my item (when in the main hand) bright with Optifine. To do this I will open another forum because by searching with the AI I understood that the "separate transforms" has some incompatibilities. Thanks for your help :)
In reply to braserpl regarding the item animation that is seen for each item it is because Geckolib does not perform the animations on the individual item but on the ItemStack of that kind