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

I am adding crops to my mod and when I click with the seed my client crashes. But if I give myself the block with commands I can place the plant on grass and farmland and when I click on the plant with bone meal and it works. I just need help making the seeds plant the crop.

 

Error:

 

 

Reveal hidden contents

 

~ Ronaldi2001

  • Author

Seed Class:

 

 

Reveal hidden contents

 

 

Crop Class:

 

 

Reveal hidden contents

 

~ Ronaldi2001

  • Author

I followed the video below to help me, it works for him. Someone in the comments of the video has the same problem.

 

 

 

Sorry I just figured out that there is an insert code button for code I will use it next time.

~ Ronaldi2001

This is the Vanilla implementation of ItemSeeds#getPlant:

public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
  return this.crops.getDefaultState();
}

Where this.crops is assigned from the first parameter of the constructor. In your case, it is somehow null.

 

Ensure your crop variable is not null when your seed's constructor is called or override the method to return your own state.

Show your main class.

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.

  • Author
  On 4/3/2016 at 11:30 PM, wehttam664 said:

This is the Vanilla implementation of ItemSeeds#getPlant:

public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
  return this.crops.getDefaultState();
}

Where this.crops is assigned from the first parameter of the constructor. In your case, it is somehow null.

 

Ensure your crop variable is not null when your seed's constructor is called or override the method to return your own state.

 

What would I put to override the state of the crop.

~ Ronaldi2001

  • Author
  On 4/4/2016 at 1:06 AM, Draco18s said:

Show your main class.

 

Main Class:

 

 

Reveal hidden contents

 

 

Crops Class:

 

 

Reveal hidden contents

 

 

Items Class for seed:

 

 

Reveal hidden contents

 

~ Ronaldi2001

You initialize Items before Blocks, but pass a Block (which is null) to your Item's constructor.

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.

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.