Grass Hooks
With this hook you will be able to make an item drop when you break a block of tall grass. This can be used to add your own seed types to the game without adding a new form of generation. Like the other hooks this is a single line of code that is placed within @Mod/Core files Initialization events.
MinecraftForge.addGrassSeed(new ItemStack(TheItem), Rarity);
This hook requires two things. The first is the ItemStack. This is where you put the item you want the grass to drop. This will commonly be represented by Yourmod.Youritem or YourModItems.YourItem.
The second thing you will need to put is the rarity. The rarity for vanilla seeds is 10, numbers below it are less common then seeds and numbers above 10 are more common than seeds. If the number is 10 then they will drop just as often as seeds.
This is an example of how I do this in my mod.
MinecraftForge.addGrassSeed(new ItemStack(RWItems.rupeeGreen), 10);
MinecraftForge.addGrassSeed(new ItemStack(TheItem), Rarity);
This hook requires two things. The first is the ItemStack. This is where you put the item you want the grass to drop. This will commonly be represented by Yourmod.Youritem or YourModItems.YourItem.
The second thing you will need to put is the rarity. The rarity for vanilla seeds is 10, numbers below it are less common then seeds and numbers above 10 are more common than seeds. If the number is 10 then they will drop just as often as seeds.
This is an example of how I do this in my mod.
MinecraftForge.addGrassSeed(new ItemStack(RWItems.rupeeGreen), 10);