Jump to content

Recommended Posts

Posted

Hello, I have created a tnt block called "Johnny TNT" (don't ask why), and when i'm using it in-game, it shows the texture i'm using in my hand, but not when I place it down.

I have a feeling I need to change something in the blockstates package/folder, because I get these errors when running the game:

[19:08:36] [Client thread/ERROR] [FML]: Exception loading model for variant cmo:blockjohnny_tnt#explode=true for blockstate "cmo:blockjohnny_tnt[explode=true]"

and

[19:08:36] [Client thread/ERROR] [FML]: Exception loading model for variant cmo:blockjohnny_tnt#explode=false for blockstate "cmo:blockjohnny_tnt[explode=false]"

here is the TNT block class (I haven't created the tnt entity class yet):

  Reveal hidden contents

Yes, I did in fact copy the BlockTNT class, but for learning purposes. I might change it later.

Right now I need help with the Johnny TNT textures.

Here is a picture:

  Reveal hidden contents

 

Posted

These first 3 files are json files:

Block model:

name: johnny_tnt.json

  Reveal hidden contents

Item Model for Block:

name: blockjohnny_tnt.json

  Reveal hidden contents

Blockstate Json:

name: blockjohnny_tnt.json

  Reveal hidden contents

 

The texture for the block is in the block textures file and is named johnny_tnt.png (attached)

 

Reference class (a lot of the blocks are named after my friend):

  Reveal hidden contents

Main mod class:

  Reveal hidden contents

 

johnny_tnt.png

Posted

you should name the json files with the unlocalized name so if my unlocalized name was mytnt you would call the json file mytnt.json and in it you would put

{
    "parent": "block/cube_all",
    "textures": {
        "all": "cmo:blocks/mytnt"
     }
}

 

Posted

So I changed all of the json files to the unlocalized name and here's what happened. (It's attached)

Also here is the console:

  Reveal hidden contents

 

2017-06-17_19.58.04.png

Posted

1) [19:56:14] [Client thread/WARN] [FML]: * The object Block{cmo:blocklithium_block} has been registered twice for the same name cmo:blocklithium_block.

 

You have a block being registered under the same name as another block

 

2) Caused by: java.io.FileNotFoundException: cmo:models/item/blockjohnny_tnt.jso

Caused by: java.io.FileNotFoundException: cmo:blockstates/blockjohnny_tnt.json

 

You have missing JSON files. Or they're in a different place than they should be.

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 6/17/2017 at 11:34 PM, AnthonyFuller said:

have you set unlocalized names and put the texture in blocks and added a model files as a json

Expand  

 

The unlocalised name has nothing to do with models, it's only used for localisation. The registry name is what determines the default blockstates file/item model location. I have an explanation of the model loading process and where models are loaded from here.

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 (edited)
  On 6/18/2017 at 3:35 AM, Draco18s said:

2) Caused by: java.io.FileNotFoundException: cmo:models/item/blockjohnny_tnt.jso

Caused by: java.io.FileNotFoundException: cmo:blockstates/blockjohnny_tnt.json

 

You have missing JSON files. Or they're in a different place than they should be.

Expand  

I understand that. I was having problems with the current json files named correctly and in the right place. The problem is within the json files and the reason why they are named incorrectly is because I was following Anthony Fuller's instructions.

 

I think that the TNT type block requires a different type of json then a regular block.

Edited by Cmonster
Posted
  On 6/18/2017 at 1:49 PM, Cmonster said:

I think that the TNT type block requires a different type of json then a regular block.

Expand  

That doesn't even make sense.

There are exactly 2 types of JSON file:

 - Model

 - Blockstate

Every block that has more than one state uses both. All other blocks don't need the blockstate file.

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 6/18/2017 at 2:38 PM, Draco18s said:

That doesn't even make sense.

There are exactly 2 types of JSON file:

 - Model

 - Blockstate

Every block that has more than one state uses both. All other blocks don't need the blockstate file.

Expand  

What I meant was what was inside of either of the json files. Not the type. I understand that blocks use blockstate and model json files.

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



×
×
  • Create New...

Important Information

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