Jump to content

[1.8] Changing Drops of Vanilla Blocks


konxet

Recommended Posts

Hi. I'm currently working on a Minecraft Forge 1.8 mod that I plan to release later this year. The mod involves new crops, and in order to obtain seeds for the new crops, you need to break regular grass blocks, just like getting wheat seeds. The problem is, the method of doing this has changed since I last worked with it.

 

This is the code that I had before:

 

        @SubscribeEvent
public void BlockDestroyed(HarvestDropsEvent event) {

	if (event.harvester != null) {

		if (event.block == Blocks.tallgrass)) {

			event.dropChance = (float) 0.3;
			event.drops.add(new ItemStack(CustomItems.tomato_seed, 1));
		}

	}
}

 

This is how the class was registered:

 

        @Mod.EventHandler
public static void preInit(FMLPreInitializationEvent event) {

	MinecraftForge.EVENT_BUS.register(new CustomEventHandlers());
}

 

CustomEventHandlers is the name of the class where the events are contained.

 

This doesn't appear to work in Minecraft Forge 1.8.

 

Any help would be highly appreciated. Thanks in advance.

 

- Jarod Beau

mail.konxet@gmail.com

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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