Posted May 12, 20205 yr I'm trying to add an item to be dropped by grass. How would I go about this? 1.14
May 12, 20205 yr Sounds like you probably want global loot modifiers https://github.com/MinecraftForge/MinecraftForge/blob/1.14.x/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java
May 12, 20205 yr Author That seems overly complicated just to make an already existing block drop a second item.
May 12, 20205 yr Author I found something on another post from Forge 1.11.2 @SubscribeEvent public void yourPlayerHarvestEvent(HarvestDropsEvent event) { if (event.getHarvester() != null) { if (event.getState() == Blocks.QUARTZ_ORE.getDefaultState()) { event.setDropChance(0.1f); event.getDrops().add(new ItemStack(ItemRegistry.herkimer_diamond, 1)); } } } Has it really changed that much in so little versions or is there a simpler way of doing it?
May 12, 20205 yr Just now, TheCrudNation said: HarvestDropsEvent event Doesn't exist any more. Has been replaced by Global Loot Modifiers If you don't want to use them then do it this way: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/EventHandlers.java#L49-L53 https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderfarming/loot_tables/blocks/grass.json Edited May 12, 20205 yr by Draco18s Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 12, 20205 yr Author I'm quite new to java, how does one make sure the event is fired? I created a class called EventHandler inside of my handlers package and it contains literally just this. @EventBusSubscriber public class EventHandler { } so anything I put in here will be fired?
May 12, 20205 yr More or less. Info on events here: https://mcforge.readthedocs.io/en/latest/events/intro/
May 12, 20205 yr 1 minute ago, TheCrudNation said: So I don't need to reference my EventHandler class anywhere else? As long as it's got the EventBusSubscriber annotation and the event handler methods are static, and have the SubscribeEvent annotation, you should be good to go.
May 13, 20205 yr 6 hours ago, diesieben07 said: Can you stop recommending this crappy way to people? Sure can. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.