Jump to content

1,11,2 Custom Block .json not rendering


modblockminer

Recommended Posts

I am new to modding and could really use some help.  I have been trying to get my custom chair block to render and cannot figure this out.  It renders my chair with texture in my inventory, in my hand, and spins on the ground if I drop it...but I keep getting the purple/black block if I place it on the ground.

 

Here is what I have:

Console output

https://pastebin.com/034k0vY9

Blockstate.json

https://pastebin.com/ywF79D1P

Block.json

https://pastebin.com/xMhs4Vpe

Item.json

https://pastebin.com/0P2MBUjF

Link to comment
Share on other sites

Okay I see that #normal in the consle...but what needs to be done to fix it?

[12:19:19] [Client thread/ERROR] [FML]: Exception loading model for variant stevemod:blockoakchair#normal for blockstate "stevemod:blockoakchair"

 

 I thought "normal" was only specified in the blockstate if you only have 1 variant.  I tried adding "normal": to my blockstate and it didn't do anything.

{
    "variants": {
            "facing=up": { "model": "stevemod:blockoakchair" },
            "facing=east": { "model": "stevemod:blockoakchair" },
            "facing=south": { "model": "stevemod:blockoakchair", "y": 90 },
            "facing=west": { "model": "stevemod:blockoakchair", "y": 180 },
            "facing=north": { "model": "stevemod:blockoakchair", "y": 270 } 
    }
}

 

Link to comment
Share on other sites

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I appreciate the help everyone.  I'm determined to learn this stuff regardless of how upside down my brain is right now.

Here is the rest of my code:

ModBlocks.java

https://pastebin.com/iw77ifVf

 

blockOakChair.java

https://pastebin.com/eYZ75eY1

 

 

1 hour ago, Draco18s said:

Draco18s...So it looks like you state your whole block into your blockstate?  Do you even have a block.json?

Link to comment
Share on other sites

9 minutes ago, modblockminer said:

Draco18s...So it looks like you state your whole block into your blockstate?  Do you even have a block.json?

Uh what do you mean "my whole block"?

Of course I have a model:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/harderores/models/block/axel.json

Two for this block, actually:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/harderores/models/block/frame.json

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Forgive me if I'm speaking jibberish...still learning.

Ah okay...of course. Was a bit confused when I first saw your blockstate and it looks much different than mine.  I can see you still need the block.json to specify your cubes to design your block.

I will try and tweak mine a bit based on your example and see what happens.

 

6 hours ago, diesieben07 said:

As you can see in the console it is trying to load the "normal" variant from your blockstate, but that variant does not exist there.,

I guess I am confused as to where/why "normal" is defined and trying to load from the blockstate.

 

I was doing pretty good with the modding basics of items/blocks/recipes until I decided to try a custom block.  Kicking my butt.

Link to comment
Share on other sites

2 minutes ago, modblockminer said:

I guess I am confused as to where/why "normal" is defined and trying to load from the blockstate.

 

I was doing pretty good with the modding basics of items/blocks/recipes until I decided to try a custom block.  Kicking my butt.

Its from when you register a model for your item. You are doing that, yes?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

7 minutes ago, Draco18s said:

Its from when you register a model for your item. You are doing that, yes?

As in register here?

public class ModBlocks {

    public static Block rubyblock;
    public static Block oakchair;
        
    public static void init() {
        rubyblock = new blockRuby();
        oakchair = new blockOakChair();
    }
    
    public static void register() {
        registerBlock(rubyblock);
        registerBlock(oakchair);
    }
    
    private static void registerBlock(Block block) {
        GameRegistry.register(rubyblock);
        GameRegistry.register(oakchair);
        ItemBlock item = new ItemBlock(block);
        item.setRegistryName(block.getRegistryName());
        GameRegistry.register(item);        
    }
    

    public static void registerRenders() {
        registerRender(rubyblock);
        registerRender(oakchair);
    }
    
    private static void registerRender(Block block) {
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
        block.setCreativeTab(Main.tabblocks);
    }

Link to comment
Share on other sites

If you want your block to have a variable state (like direction), you need to use blockstates. Define a property, override getMetaFromState and getStateFromMeta, and whatever methods you need to set the state as you want it (e.g. getStateForPlacement).

 

If you don't want to do this, instead you can simplify your blockstates file - remove the "facing" variants and just provide a "normal" variant and the model will always be facing the same direction.

Link to comment
Share on other sites

Quote

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));

Aw for fuck's sake.

Use ModelLoader.setCustomModelResourceLocation, stop using old, out of date methods that are broken and don't work properly.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

The mesher is a tricky method called during init. Used by vanilla but now discouraged for mods, it's tricky because certain things need to be called in a certain order (and the client side-only proxy is involved, which separates some of those statements in code space). I  believe that Forge created the custom location method because it's much less fragile.

 

Note that it's called during preInit, not init.

 

The threads discouraging mesher use run like a rash across this forum going back almost 2 years. Any modder facing any rendering problems should have come across them when searching for answers to avoid posting repeat questions. That's why Draco sounds frustrated: When someone shows up here using the mesher call, it means that the modder's scholarship stopped at a long obsolete tutorial without reading any threads written in the last 22 months.

  • Like 4

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

On 5/15/2017 at 5:33 AM, Draco18s said:

Aw for fuck's sake.

Use ModelLoader.setCustomModelResourceLocation, stop using old, out of date methods that are broken and don't work properly.

Draco18s might have anger management issues...I don't care.  If it's crap...please tell me.  If I don't have the proper methods...it's simply because I didn't know.  That's why I came to the forums.

I'm new to all of this and trying to learn.  I probably should have learned some java to start, but that would have been mind numbing and I would have quit.  I enjoy MC and figured modding would keep my interest and learn some coding.

 

19 hours ago, jeffryfisher said:

The threads discouraging mesher use run like a rash across this forum going back almost 2 years. Any modder facing any rendering problems should have come across them when searching for answers to avoid posting repeat questions. That's why Draco sounds frustrated: When someone shows up here using the mesher call, it means that the modder's scholarship stopped at a long obsolete tutorial without reading any threads written in the last 22 months.

Yes, jeffryfisher...I started with 3 different video/written tutorials trying to learn the basics...so it sounds like I was taught incorrectly.  From your suggestion, I will get better info from the forums. Thank you.

 

On 5/14/2017 at 11:52 PM, Jay Avery said:

If you want your block to have a variable state (like direction), you need to use blockstates. Define a property, override getMetaFromState and getStateFromMeta, and whatever methods you need to set the state as you want it (e.g. getStateForPlacement).

 

If you don't want to do this, instead you can simplify your blockstates file - remove the "facing" variants and just provide a "normal" variant and the model will always be facing the same direction.

Jay Avery...I was able to successfully render a basic ore block using my own texture.  My next step was design my own block.  I created a chair which had several cube elements all using the same texture.  So yes, my blockstate has facing variants.

 

I'm still trying to figure out from the console error [ [FML]: Exception loading model for variant stevemod:blockoakchair#normal ] is the issue with my blockstate or somewhere else in the code.  I guess I don't understand why it's looking for a #normal variant when I'm not using it.

Link to comment
Share on other sites

4 minutes ago, modblockminer said:

Jay Avery...I was able to successfully render a basic ore block using my own texture.  My next step was design my own block.  I created a chair which had several cube elements all using the same texture.  So yes, my blockstate has facing variants.

 

I'm still trying to figure out from the console error [ [FML]: Exception loading model for variant stevemod:blockoakchair#normal ] is the issue with my blockstate or somewhere else in the code.  I guess I don't understand why it's looking for a #normal variant when I'm not using it.

Your block class doesn't contain a facing property though. You have to define it in the block's code, otherwise how does minecraft know when to use which variants from the blockstate file? When you don't specify variants, it uses "normal" by default. The link I sent explains how to create a block property.

Edited by Jay Avery
  • Like 1
Link to comment
Share on other sites

5 hours ago, modblockminer said:

Yes, jeffryfisher...I started with 3 different video/written tutorials trying to learn the basics...so it sounds like I was taught incorrectly.  From your suggestion, I will get better info from the forums. Thank you

On 4/6/2017 at 3:18 PM, Draco18s said:

the tutorial you were using is old and shitty.

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Okay...here is where I am at.

On 5/15/2017 at 5:33 AM, Draco18s said:

Aw for fuck's sake.

Use ModelLoader.setCustomModelResourceLocation, stop using old, out of date methods that are broken and don't work properly.

1.  I have a working ModelLoader.setCustomModelResourceLocation method.

2.  My custom block now renders on the ground and faces correctly, BUT...it is now invisible in my inventory where is was visible before.

 

Any suggestions?

Edited by modblockminer
Link to comment
Share on other sites

38 minutes ago, modblockminer said:

Okay...here is where I am at.

1.  I have a working ModelLoader.setCustomModelResourceLocation method.

2.  My custom block now renders on the ground and faces correctly, BUT...it is now invisible in my inventory where is was visible before.

 

Any suggestions?

 

When are you calling ModelLoader.setCustomModelResourceLocation? It needs to be called before init, otherwise it won't do anything.

 

If you register your Items (including ItemBlocks) in RegistryEvent.Register<Item> (the new and recommended way), register the models in ModelRegistryEvent. If you register them in preInit (the old way), register the models in preInit as well.

 

The FML log will usually have an error message telling you why a particular model wasn't loaded. If you don't know how to interpret the errors, post the full log using Gist.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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

    • So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI)   I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
  • Topics

×
×
  • Create New...

Important Information

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