Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

  • Author

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?

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.

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.