Hey Guys,
I Have created a custom loot drop table and its working for entities but when I try and add drops to vanilla blocks it doesn't seem to be working. Keep in mind that I am a complete Java noob. I usually program in C and C++. Similar but different. Anyways. My code I am using is below. I know the top part is right. But I cant work out a way to ID the block I want the drop to be added to.
@SubscribeEvent
public void onHarvestEvent(HarvestDropsEvent event)
{
if (event.getHarvester() != null) //Checks to make sure player is harvesting.
{
if(event.equals(Blocks.STONE)) //Is meant to confirm which block is being broken.
{
//This will add my item to the block as it drops with 100% drop rate while I am testing.
event.setDropChance((float) 1.0F);
event.getDrops().add(new ItemStack(ModItems.DOLLAR_BILL,1));
}
}
}
Not sure if the second half works yet but I am 100% certain that the if(event.equals(Blocks.STONE) is incorrect. Someone with some knowledge on working with Forge 1.12.2 would be much appreciated.