Jump to content

Recommended Posts

Posted

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

Posted

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 } 
    }
}

 

Posted

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.

Posted

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

 

 

  On 5/15/2017 at 12:05 AM, Draco18s said:
Expand  

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

Posted
  On 5/15/2017 at 1:36 AM, modblockminer said:

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

Expand  

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.

Posted

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.

 

  On 5/14/2017 at 7:41 PM, 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.,

Expand  

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.

Posted
  On 5/15/2017 at 2:22 AM, 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.

Expand  

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.

Posted
  On 5/15/2017 at 2:24 AM, Draco18s said:

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

Expand  

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);
    }

Posted

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.

Posted
  Quote

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

Expand  

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.

Posted

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.

Posted
  On 5/15/2017 at 12:33 PM, 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.

Expand  

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.

 

  On 5/15/2017 at 7:04 PM, 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.

Expand  

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/15/2017 at 6:52 AM, 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.

Expand  

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.

Posted (edited)
  On 5/16/2017 at 5:05 PM, 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.

Expand  

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
Posted
  On 5/16/2017 at 5:05 PM, 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

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

the tutorial you were using is old and shitty.

Expand  

 

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.

Posted (edited)

Okay...here is where I am at.

  On 5/15/2017 at 12:33 PM, 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.

Expand  

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
Posted
  On 5/18/2017 at 4:42 AM, 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?

Expand  

 

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.

Posted

Thank you to everyone that pitched in.  I got it working thanks to all your suggestions.  It's probably a bit messy,...but its working.  Thank you, thank you, thank you.

 

Now onto the next challenge...whatever that may be.

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

    • But your Launcher does not find it   Java path is: /run/user/1000/doc/3f910b8/java Checking Java version... Java checker returned some invalid data we don't understand: Check the Azul Zulu site and select your OS and download the latest Java 8 build for Linux https://www.azul.com/downloads/?version=java-8-lts&package=jre#zulu After installation, check the path and put this path into your Launcher Java settings (Java Executable)
    • Try other builds of pehkui and origins++ until you find a working combination
    • Some Create addons are only compatible with Create 6 or Create 5 - so not both versions at the same time Try older builds of Create Stuff and Additions This is the last build before the Create 6 update: https://www.curseforge.com/minecraft/mc-mods/create-stuff-additions/files/6168370
    • βœ… Crobo Coupon Code: 51k3b0je β€” Get Your \$25 Amazon Gift Card Bonus! If you’re new to Crobo and want to make the most out of your first transaction, you’ve come to the right place. The **Crobo coupon code: 51k3b0je** is a fantastic way to get started. By using this code, you can unlock an exclusive **\$25 Amazon gift card** after completing your first eligible transfer. Let’s dive deep into how the **Crobo coupon code: 51k3b0je** works, why you should use it, and how to claim your reward. --- πŸŒŸ What is Crobo? Crobo is a trusted, modern platform designed for **international money transfers**. It offers fast, secure, and low-cost transactions, making it a favorite choice for individuals and businesses alike. Crobo is committed to transparency, low fees, and competitive exchange rates. And with promo deals like the **Crobo coupon code: 51k3b0je**, it becomes even more attractive. Crobo focuses on providing customers with: * Quick transfer speeds * Minimal fees * Safe, encrypted transactions * Great referral and promo code rewards When you choose Crobo, you’re choosing a platform that values your time, money, and loyalty. And now with the **Crobo coupon code: 51k3b0je**, you can start your Crobo journey with a **bonus reward**! ---# πŸ’₯ What is the Crobo Coupon Code: 51k3b0je? The **Crobo coupon code: 51k3b0je** is a **special promotional code** designed for new users. By entering this code during signup, you’ll be eligible for: βœ… A **\$25 Amazon gift card** after your first qualifying transfer. βœ… Access to Crobo’s referral system to earn more rewards. βœ… The ability to combine with future seasonal Crobo discounts. Unlike generic promo codes that just offer small fee reductions, the **Crobo coupon code: 51k3b0je** directly gives you a tangible, valuable reward β€” perfect for online shopping or gifting. --- ### 🎯 Why Use Crobo Coupon Code: 51k3b0je? There are many reasons why users choose to apply the **Crobo coupon code: 51k3b0je**: 🌟 **Free bonus reward** β€” Your first transfer can instantly earn you a \$25 Amazon gift card. 🌟 **Trusted platform** β€” Crobo is known for secure, fast, and affordable transfers. 🌟 **Easy to apply** β€” Simply enter **Crobo coupon code: 51k3b0je** at signup β€” no complicated steps. 🌟 **Referral opportunities** β€” Once you’ve used **Crobo coupon code: 51k3b0je**, you can invite friends and earn more rewards. 🌟 **Stackable savings** β€” Pair **Crobo coupon code: 51k3b0je** with Crobo’s ongoing offers or holiday deals for even more benefits. --- ### πŸ“ How to Use Crobo Coupon Code: 51k3b0je Getting started with **Crobo coupon code: 51k3b0je** is quick and easy. Just follow these steps: 1️⃣ **Download the Crobo app** (available on Google Play Store and Apple App Store) or visit the official Crobo website. 2️⃣ **Start the sign-up process** by entering your basic details (name, email, phone number, etc.). 3️⃣ When prompted, enter **Crobo coupon code: 51k3b0je** in the promo code or coupon code field. 4️⃣ Complete your first transaction β€” be sure to meet the minimum amount required to qualify for the reward (usually specified in Crobo’s promo terms). 5️⃣ After the transaction is verified, receive your **\$25 Amazon gift card** directly via email or within your Crobo account. --- ### πŸ’‘ Tips to Maximize Your Crobo Coupon Code: 51k3b0je Bonus πŸ‘‰ **Transfer the minimum qualifying amount or more** β€” this ensures you meet the conditions for the gift card. πŸ‘‰ **Refer friends after your signup** β€” Crobo allows users who’ve signed up with codes like **Crobo coupon code: 51k3b0je** to share their own code for extra bonuses. πŸ‘‰ **Check for additional Crobo promotions** β€” sometimes Crobo offers seasonal or regional deals that stack with the coupon code. πŸ‘‰ **Complete your transaction soon after signup** β€” many bonuses have time limits, so act quickly! --- ### πŸš€ Frequently Asked Questions about Crobo Coupon Code: 51k3b0je **Q: Can I use Crobo coupon code: 51k3b0je if I already have a Crobo account?** A: No β€” the **Crobo coupon code: 51k3b0je** is intended for **new users only**. It must be applied during the initial registration process. --- **Q: How long does it take to get the \$25 Amazon gift card after using Crobo coupon code: 51k3b0je?** A: Typically, the gift card is sent **within a few business days** after your first qualifying transfer is completed and verified. --- **Q: Are there hidden fees when using Crobo coupon code: 51k3b0je?** A: No β€” Crobo is transparent about its fees. The **Crobo coupon code: 51k3b0je** simply adds a bonus reward without increasing your costs. --- **Q: Can I combine Crobo coupon code: 51k3b0je with other promo codes?** A: The **Crobo coupon code: 51k3b0je** is generally applied as a standalone signup bonus. However, Crobo often offers **ongoing promotions** that may apply to future transactions. ---  πŸ“Œ Reference Crobo promo code: {51k3b0je} Crobo discount code: {51k3b0je} --- # 🌍 Final Thoughts If you want to enjoy safe, fast, and affordable money transfers with an added bonus, **Crobo coupon code: 51k3b0je** is your best option. Not only will you experience excellent service, but you’ll also earn a **\$25 Amazon gift card** β€” a reward that you can use immediately for shopping or gifts. πŸ‘‰ **Don’t wait β€” sign up today using Crobo coupon code: 51k3b0je and claim your bonus!**
  • Topics

Γ—
Γ—
  • Create New...

Important Information

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