Posted October 3, 20159 yr Hello, So I had an idea to make a simple mod that involves changing the levels required in order to use an anvil. I'd assume that I can just change some class files and it would work well. Most mods for forge do not seem to describe altering these class files as a possibility. They all seem to focus on the creation of new content rather than modifications, as the name mod implies is possible. How would I go about making this mod for forge? I have plenty of java experience, but no minecraft modding experience. Thanks, BobTheLawyer
October 3, 20159 yr Many Forge mods alter vanilla behaviors and characteristics using hooks that Forge provides, such as the wonderful @SubscribeEvent system. Most mods do not directly alter any vanilla class files; those that do tend to use what's known as byte code manipulation to dynamically modify the .jar file so that their mod is more likely to be compatible with others. 99.9999999% of the time, you do not need to modify any vanilla class files. In your case, Forge provides the AnvilUpdateEvent; this has a public field called 'cost' which is the amount of levels the transaction requires, and you can listen to the event, check the anvil contents, and modify the cost to whatever you want. If you truly do have plenty of Java experience, then once you get a basic modding workspace set up, this should be pretty straightforward for you to accomplish. http://i.imgur.com/NdrFdld.png[/img]
October 3, 20159 yr Author Many Forge mods alter vanilla behaviors and characteristics using hooks that Forge provides, such as the wonderful @SubscribeEvent system. Most mods do not directly alter any vanilla class files; those that do tend to use what's known as byte code manipulation to dynamically modify the .jar file so that their mod is more likely to be compatible with others. 99.9999999% of the time, you do not need to modify any vanilla class files. In your case, Forge provides the AnvilUpdateEvent; this has a public field called 'cost' which is the amount of levels the transaction requires, and you can listen to the event, check the anvil contents, and modify the cost to whatever you want. If you truly do have plenty of Java experience, then once you get a basic modding workspace set up, this should be pretty straightforward for you to accomplish. Thank you for your reply! This is exactly what I needed to know
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.