Jump to content

[1.8] Custom Crop Crash


KingYoshiYT

Recommended Posts

Hello, I am making a tomato crop for my mod, but have received a crash when I right clicked with tomato seeds on farmland. Below are the code in my classes and .json files. (Please do not judge me, I am new at making crops). Please could someone help me figure out why the game crashes when the tomato crop is placed.

 

TomatoCrop.java

http://pastebin.com/2bHQ1rdR

 

TomatoCrop.json

http://pastebin.com/MTgt1H99

 

tomato_stage_x.json              (I only uploaded 1 of the 8 of these, as the rest are the same with different item numbers, number replaced with x)

http://pastebin.com/0H0ixkaE

 

InsaneBlocks.java

http://pastebin.com/pXhX5BPj

 

InsaneFoodsInit.java

http://pastebin.com/TSFJR3Uh

 

 

Crash Log

 

http://pastebin.com/8L0ar8X2

 

If you need to see any other classes or json files, please just ask and I will give you them.

 

Thanks.

Link to comment
Share on other sites

If you look at the method that threw the exception (

ItemSeeds#getPlant

, line 61), you'll see it's trying to call

getDefaultState

on

this.crops

. The only possible value that could be

null

on that line is

this.crops

, which is set from the first argument of the constructor. This means you're passing

null

to the

ItemSeeds

constructor, probably because

InsaneFoodsInit.init

is called before

InsaneBlocks.init

.

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

thanks, I am no longer crashing, however the crops do not render. I did a bit of research and people say that the crop stages files need to be in the blockstates folder, is this correct?

 

No, the models for each stage of the crop should be in assets/if/models/block. Your blockstates file should only use the resource domain and name of each model, don't include the block/ prefix. Look at assets/minecraft/blockstates/wheat.json for an example.

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

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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