Posted November 11, 201311 yr I am making a mod that uses emeralds as money and there are buyable things. However, there needs be be a way to make emeralds more obtainable, and I thought I could make hostile mobs drop emeralds with or instead of their normal drop. So I looked at some of the code of vanilla Minecraft and saw that the class EntityZombie or EntityAnimalZombie (I forgot; under package hostile) had the method getItemDrops() or something like that, and all it does is return an item (rotten flesh). So I thought I could simply change the line return Item.rottenFlesh.getItemID(); to return Item.emeralds.getItemID();. However, I didn't know how I would put the class EntityZombie into the mod since the class already exists in vanilla Minecraft. Could I simply put it in the folder with the additional class files that I compiled after writing myself? Or is there another way to change the item drops of a hostile mob? I haven't fully read all the code of Minecraft or the documentation of forge so I don't really know of any other way to do this.
November 11, 201311 yr First of all, editing any base class and distributing it is illegal. Unless you use ASM, which is very un-needed for this situation. What I would recommend, is looking into Forge's events. Here is a great tutorial by AtomicStryker: http://www.minecraftforum.net/topic/1419836-forge-4x-events-howto/ Kain
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.