Posted February 2, 201411 yr Hi, I used to mod Minecraft using ModLoader and it let you change something in the games vanilla files (like EntityCreeper.java, for example) and it would change it when you installed the mod. I was just wondering, is there a way to do this in forge? I have changed something in the vanilla file and it works in the eclipse run option but when I install the mod into the actual game, the changes are not there.
February 2, 201411 yr Never modify base classes as it makes your mod incompatible with other mods and 95% of what you need to do can be done without base edits. However on the off chance you actually need to change a base class you should use Asm byte code manipulation which you can find tutorials for just by a google search. Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
February 2, 201411 yr Note: ASM is superadvanged Java and requires an intimate knowledge of compiled Java bytecode. 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.
February 2, 201411 yr Author Never modify base classes as it makes your mod incompatible with other mods and 95% of what you need to do can be done without base edits. However on the off chance you actually need to change a base class you should use Asm byte code manipulation which you can find tutorials for just by a google search. The mod I'm making (I should say updating from ModLoader to Forge) isn't exactly the kind of mod you use with other mods. It's more of a mod that you screw around with and have fun, nothing too serious. Even if it's the only mod installed, will I still have to use ASM? I've also been told that using an event handler (ex: MinecraftForge.EVENT_BUS.register(new EntityLivingHandler()); ) can be used instead of changing vanilla files. Should I use something like that instead?
February 2, 201411 yr Pre-gradle you can modify the base classes to your heart's content without ASM. 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.
February 2, 201411 yr Author ]But keep in mind that if you do that, it'll be a PITA to install your mod. Maybe you should tell us, what you want to achieve and why you think you need to edit base classes. Forge has hooks for a lot of stuff, and most of the time you don't need to actually edit base classes. This is my mod I'm updating from ModLoader to Forge: http://www.planetminecraft.com/mod/modloader-unnecessary-explosions-mod/ Basically when a mob/entity does something (such as a chicken laying an egg, an arrow hits something) it generates an explosion. So it's pretty much finding where these events happen in the base code and adding an explosion.
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.