Hi everyone, my first post
I'm working on my first mod, just got started and I'm having trouble showing textures. I'm trying to add a Banana ItemFood to the game. I've created a class ItemBanana that extends ItemFood, set the super(4, false) and registered the item to GameRegistry, copied my banana.png to ./resources/assets/[modid]/textures/items/banana.png and created a model for it (do I need it?) in ./resources/assets/[modid]/models/item/banana.json. I can give myself the item in game and can eat it but it is missing the texture so I think the problem is that I didn't register renders anywhere and I'm not sure how to do that, can someone help?
Edit: Giving more info on my renders. I tried this code:
if (!Minecraft.getMinecraft().world.isRemote) {
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
So if I understand correctly I'm checking if the code is running on the client and if so I'm providing location to banana resource and binding it to ItemBanana, but this gives an error Caused by: java.lang.NullPointerException, I think its because I'm doing this in preInit or is that ok?