MLGDuckboi Posted July 10, 2021 Posted July 10, 2021 (edited) I am using the event BlockEvent.BreakEvent, and I want to know how to get a World instance from the event. Using getWorld() returns an IWorld instance, so that won't help. Thanks in advance. Edited July 10, 2021 by MLGDuckboi Quote
poopoodice Posted July 10, 2021 Posted July 10, 2021 All worlds implements IWorld, so you can cast it. Quote
MLGDuckboi Posted July 10, 2021 Author Posted July 10, 2021 (edited) Sorry, bit new to programming, what do you mean by "cast it"? Edit: Nevermind, figured it out Edited July 10, 2021 by MLGDuckboi Update Quote
poopoodice Posted July 10, 2021 Posted July 10, 2021 https://sites.google.com/site/simplestjava/java-object-casting Quote
Draco18s Posted July 10, 2021 Posted July 10, 2021 On 7/10/2021 at 9:56 PM, poopoodice said: All worlds implements IWorld, so you can cast it. Expand Note that other things also implement IWorld that are not Worlds. Quote 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.
MLGDuckboi Posted July 11, 2021 Author Posted July 11, 2021 To pass to a blocks spawnDrops() method, casting worked fine Quote
MLGDuckboi Posted July 11, 2021 Author Posted July 11, 2021 I was using it to spawn extra items when a block is broken, but now I'm looking into loot modifiers since they are closer to what I need Quote
Recommended Posts
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.