stellarfirefly
Members-
Posts
4 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
stellarfirefly's Achievements
Tree Puncher (2/8)
0
Reputation
-
retrieving player on death event
stellarfirefly replied to stellarfirefly's topic in General Discussion
Update: It was a simple explanation. My production environment is two weeks old. Not a very long time, but long enough that it means it is using Forge 6.0.1 and Minecraft 1.4.2. It seems changes were made (for the better) so that this code works just fine... in 6.3.0. >_> Thanks again for the advice! -
retrieving player on death event
stellarfirefly replied to stellarfirefly's topic in General Discussion
Okay, this is interesting. I gave it a try and it seems to work just fine within my development environment. But pushing it out to production, I keep getting an error that the event.entity field does not exist. I crawled around the code some, and it seems like event.entityLiving is also a viable option. But just like before, using that works just fine when running and testing it in Eclipse, but once I zip it up and drop it onto the production server, crash and burn: "[sEVERE] [Minecraft] Encountered an unexpected exception NoSuchFieldError / java.lang.NoSuchFieldError: entityLiving" Any ideas? -
I'm intercepting the entityDeath (correction, the LivingDeathEvent) event and I want to retrieve the "death message" if it is a player. The only data passed to this handler is a DamageSource object (event.source). The death message itself may be retrieved with event.source.getDeathMessage(), but that method wants to be passed an EntityPlayer object. So then two questions: 1. How can I determine within this event handler if it triggered upon a player death? Because it seems to also trigger on animal and monster deaths. 2. Where exactly do I find the proper EntityPlayer to pass to getDeathMessage()? My guess for #2 is that it is the EntityPlayer for the player in question, but the only object passed to this handler is the damage source. So I'm guessing that if someone can tell me how to figure out the "damage target" then that will answer both of these questions. adv(thanks)ance