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
[email protected]