Posted August 17, 20187 yr I'm using the HarvestDropsEvent to change the drops of cobblestone and gravel when using any of my mods hammers. Strangely, the game crashes when joining a world with "NullPointerException", heres the full report: https://pastebin.com/Hq6HSZG4 Heres my EventHandler class: https://pastebin.com/pLj27sKj Thanks! Edited August 17, 20187 yr by xXJamie_Xx
August 17, 20187 yr What happens when water washes away grass and flowers? A Harvest event is fired where event.getHarvester() is null. 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.
August 17, 20187 yr Author 23 minutes ago, Draco18s said: What happens when water washes away grass and flowers? A Harvest event is fired where event.getHarvester() is null. It shouldn't do anything different but not sure how to do that?
August 17, 20187 yr Author 53 minutes ago, diesieben07 said: You need to handle the case where getHarvester returns null. Currently you do not handle that case (you try to call a method on it regardless). I've tried if (event.getHarvester() == null) { return; } but it still returns the error. EDIT: Moved it to before my initial IF statement and it appears to be working, thanks for the support, very much appreciated. Edited August 17, 20187 yr by xXJamie_Xx
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.