Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to sub forum page

General forum

Non-course related subjects

3. Programming help

[1.7.2] getting default mob drops (difference eclipse/exported)

  • 2014-05-31 23:36:05
    Hello,
    I had this idea for a mod that spawns particles around an entity of the item that it drops, i found this method in EntityLiving called getDropItem(), and i wanted to use this to get the item the particle should look like, the only problem is that this method is protected, i used java reflection to still reach this method, and in my dev environment it seemed to work fine, it spawned the particles every time, but when i exported the mod and tried it, it didn't spawn any particles at all. this is the code i am using:

    LivingUpdateEventHandler:
    https://gist.github.com/anonymous/cf4dd49d5de35af5a8a3

    EntityItemFX:
    https://gist.github.com/anonymous/1a5c7715ca01c1ac077c

    ParticleHelper:
    https://gist.github.com/anonymous/fbeee5aee9c7ea08e113

    I have looked into the console and i have noticed the problem, entities that do have a getDropItem() method cause a noSuchMethodException if i run the exported version of the mod, however the same entity doesn't cause this exception in eclipse...

    does anybody know what could be the cause of this?
  • 2014-06-01 02:46:17
    ok, i found the problem, since i use a String to find the method within the class i can't use "getDropItem" outside eclipse, i need the obfuscated name of getDropItem, does anybody know where i can find this obfuscated name?
  • 2014-06-01 03:15:50
    i found the obfuscated name, it was func_146068_uif .

    if anyone wants to know, i found it by opening the reobf file of mcp with a tekst editor
    it works great now
  • Log in or sign up to reply to this thread