I created a block model using java and rendered with TESR and the block renders fine I just dont know how to get the item block to render. Any help would be greatly appreciated
It is possible to register a TESR for an item using ForgeHooksClient.registerTESRItemStack, but this is deprecated and marked for removal as soon as possible.
You should be using the baked model system for items, either JSON/OBJ/B3D model files or models created at runtime using IModel/IBakedModel.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Well that will work for some of my blocks but im also adding chest.
The way im doing chest is im using the MC chest model then using my own render to texture it and because im not creating traps or double chest I cant use the MC chest render Iv tried changing it to fit for me but I just cant get it to work.
Ok looking around if i do decide to go with JSON models, other than having to create more textures for the animation is there any other prob i may run into.
Ok looking around if i do decide to go with JSON models, other than having to create more textures for the animation is there any other prob i may run into.
Forge has an animation system for baked models, but there's not a lot of documentation for it. There are some helpful links in this thread.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
It may bit a bit hacky but Iv figured out at least one way to make this work. Create a basic model of your block in json format then add a display method to it that way you can scale and rotate your model to look good in the hand and gui. The hard part is getting the display to look right but with the use of f3 t its not too bad. Put into your models/item folder and it looks good. http://pastebin.com/qGf6WQUq
maybe I can do it in the tile entity using the on open and on close methods. Ether way Ill keep digging and thanks for the advice.
You can sill use a "weird" hacky thing that is called the TileEntityItemStackRenderer. You can override and call it in a child/parent way in order to use it as a hook (aka the good old IItemRender) Here is a working (but not finished) example. BUT PLEASE! Use this as a last option as it is a bit slower than a json model due to the hook being badly coded. (we can't do much about that)
Also it is highly recommended to use render lists when rendering to make the performance gap a bit smaller.
Edit: if you are going to use this method than please note that you will need to check if an item is using a "IItemRenderer" for every single item that is rendered every single frame.
So because of that you need to make sure that you have a lighting fast system for checking that. This is my solution.
You can sill use a "weird" hacky thing that is called the TileEntityItemStackRenderer. You can override and call it in a child/parent way in order to use it as a hook (aka the good old IItemRender) Here is a working (but not finished) example. BUT PLEASE! Use this as a last option as it is a bit slower than a json model due to the hook being badly coded. (we can't do much about that)
Also it is highly recommended to use render lists when rendering to make the performance gap a bit smaller.
Edit: if you are going to use this method than please note that you will need to check if an item is using a "IItemRenderer" for every single item that is rendered every single frame.
So because of that you need to make sure that you have a lighting fast system for checking that. This is my solution.
So because this is slower than a json it would prob be best to use the above item model method I talked about above, it may require a bit more work but i think it will be a bit faster and it looks better than i thought it would
So because this is slower than a json it would prob be best to use the above item model method I talked about above, it may require a bit more work but i think it will be a bit faster and it looks better than i thought it would
Yeah well if the json allows you to make your item model than go for it.
Rollback Post to RevisionRollBack
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Yes surprised me as well when I started 1.10 modding I was using the default blockstate method which means you need to create a block model as well as a item model that parents the block model.
But I found the blockstate forge hook that allows you to do both models in the blockstate so I haven't made any block/item models in a while, and last night I was looking at some tutorials that were using the default method which got me to thinking that since the item model parents the block model maybe I could just bypass the block modle and just put it into the item model folder and to my great surprise and relief it worked.
However it is nice to know that if a model is too complex to create with json that you can still do a type of IItemRender with TileEntityItemStackRenderer.
Edit; there is one other problem Iv found and that is if you have a block state method in your block you will need to create a dummy block state for my chest example above it uses the facing method so it keep spamming the console about needing a block state with facing . This is what i came up with http://pastebin.com/sta4zxu8 if you have other block state methods it should be similar just pop the fields with generic or null fields.
Final Edit (I hope): in your dummy model you need to use cube not cube_all
I created a block model using java and rendered with TESR and the block renders fine I just dont know how to get the item block to render. Any help would be greatly appreciated
You can't. It is not possible.
You should have made your block a .json model. I'm in the same boat you are and instead of remaking my block I just made a separate item to place it.
Mine Craft is doing it so there has to be a way I just cant find the method MC is using
Vanilla minecraft doesn't use TESR's for an actual blocks rendering anymore. It is only used for things like the beacons beam and such.
It is possible to register a TESR for an item using ForgeHooksClient.registerTESRItemStack, but this is deprecated and marked for removal as soon as possible.
You should be using the baked model system for items, either JSON/OBJ/B3D model files or models created at runtime using IModel/IBakedModel.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Well that will work for some of my blocks but im also adding chest.
The way im doing chest is im using the MC chest model then using my own render to texture it and because im not creating traps or double chest I cant use the MC chest render Iv tried changing it to fit for me but I just cant get it to work.
Ok looking around if i do decide to go with JSON models, other than having to create more textures for the animation is there any other prob i may run into.
Forge has an animation system for baked models, but there's not a lot of documentation for it. There are some helpful links in this thread.
I created a JSON chest model for my mod here.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Dang I hate this I want IItemRender back this new render system is a headache. However if I can figure out a way to switch the blockstate on open and close I may be able to use http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/2715476-block-models-json-model-animator
maybe I can do it in the tile entity using the on open and on close methods. Ether way Ill keep digging and thanks for the advice.
It may bit a bit hacky but Iv figured out at least one way to make this work. Create a basic model of your block in json format then add a display method to it that way you can scale and rotate your model to look good in the hand and gui. The hard part is getting the display to look right but with the use of f3 t its not too bad. Put into your models/item folder and it looks good. http://pastebin.com/qGf6WQUq
You can sill use a "weird" hacky thing that is called the TileEntityItemStackRenderer. You can override and call it in a child/parent way in order to use it as a hook (aka the good old IItemRender)
Here is a working (but not finished) example.
BUT PLEASE! Use this as a last option as it is a bit slower than a json model due to the hook being badly coded. (we can't do much about that)
Also it is highly recommended to use render lists when rendering to make the performance gap a bit smaller.
Edit: if you are going to use this method than please note that you will need to check if an item is using a "IItemRenderer" for every single item that is rendered every single frame.
So because of that you need to make sure that you have a lighting fast system for checking that. This is my solution.
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
So because this is slower than a json it would prob be best to use the above item model method I talked about above, it may require a bit more work but i think it will be a bit faster and it looks better than i thought it would
Yeah well if the json allows you to make your item model than go for it.
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Yes surprised me as well when I started 1.10 modding I was using the default blockstate method which means you need to create a block model as well as a item model that parents the block model.
But I found the blockstate forge hook that allows you to do both models in the blockstate so I haven't made any block/item models in a while, and last night I was looking at some tutorials that were using the default method which got me to thinking that since the item model parents the block model maybe I could just bypass the block modle and just put it into the item model folder and to my great surprise and relief it worked.
However it is nice to know that if a model is too complex to create with json that you can still do a type of IItemRender with TileEntityItemStackRenderer.
Edit; there is one other problem Iv found and that is if you have a block state method in your block you will need to create a dummy block state for my chest example above it uses the facing method so it keep spamming the console about needing a block state with facing . This is what i came up with http://pastebin.com/sta4zxu8 if you have other block state methods it should be similar just pop the fields with generic or null fields.
Final Edit (I hope): in your dummy model you need to use cube not cube_all