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

Hi there.

 

I'm exploring custom crops in modding and I thought I had things figured out but my crop never drops anything: no seeds, no custom crops no matter what the crop's age is.

 

I also tried changing the items in getSeed() and getCrop() to Items.WHEAT_SEEDS and Items.WHEAT respectively, just in case it was an issue with initialization of my custom items but it doesn't change anything.

 

Below is my code for the crop class, am I doing something wrong?

 

public class BlockCustomCropBottom extends BlockCrops {
	
	// Blocks's registry name
	private static final String REGISTRY_NAME = "custom_crop_bottom";
	// Blocks's unlocalized name
	private static final String UNLOCALIZED_NAME = TestMod.MOD_ID + "."
			+ REGISTRY_NAME;
	
	public BlockCustomCropBottom() {
		// Set registry and unlocalized name of the block
		this.setRegistryName(REGISTRY_NAME);
		this.setUnlocalizedName(UNLOCALIZED_NAME);
	}
	
	// Returns the seed belonging to this crop
	@Override
	protected Item getSeed() {
		System.out.println("\n\nSeeds\n");
		
		return Items.WHEAT_SEEDS;
	}
	
	// Returns the crop item gained when this crop is harvested
	@Override
	protected Item getCrop() {
		return Items.WHEAT;
	}
	
}

 

Thanks in advance.

11 minutes ago, LKloosterman said:

System.out.println("\n\nSeeds\n");

Does this ever get called?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author
1 minute ago, Cadiboo said:

Does this ever get called?

Nope, I used it to check but it never gets printed, which means to me that the function itself isn't used which is... strange.

Step through your code with the debugger, see where that method would normally get called. Find out the difference between stuff that works and your code

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author
23 minutes ago, Cadiboo said:

Step through your code with the debugger, see where that method would normally get called. Find out the difference between stuff that works and your code

About that, isn't the method called by MC/Forge when the plant is broken?

 

Edit: To clear things up, I'm not really sure where to put the breakpoints/check things out because if my function isn't even being called then it won't do much to put it there.

Edited by LKloosterman

The vanilla equivalent. Find out how it normally works

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

So, we can go ahead and close or remove this thread, it turns out the "issue" had nothing to do with Forge or modding, and mostly just my stupidity... :P

Please post the solution for people with same problem!

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

The solution? Make sure you're in survival mode. ?

 

I was in Creative mode for testing and forgot to switch over to survival mode which means no drops when destroying blocks!

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

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.