Posted September 12, 20187 yr I am brand new to modding Minecraft. I plan on doing only entity stuff like modding the AI for example. Unfortunately the forge docs are VERY lacking right now on how to really do much. It doesn't even have an entity section. Before I dive into hours of code review, debugging and running tests, can someone tell me real quick if we can mod existing behavior? I even have an exact example: Take EntityLiving.java, method: protected void despawnEntity() This is the code that despawns entities if they are too far from the player. How can I change this behavior to make the despawn rules different? It is easy right? Any quick pointers?
September 12, 20187 yr Author OK thanks. Yes, I started looking at the mineforge codebase and see its got a ton of event handlers. I will start with these. I am reading/assuming that these events intercept game actions and can even cancel them if you set the cancel flag. I'll dive in from here.
September 13, 20187 yr Yes. For modifying vanilla behavior you can first look for public fields and methods. For example entity AI is contained in a public list that you can modify directly. After that look at Forge events. Also some vanilla behaviour such as loot tables, achievements, recipes, models, etc., is now defined by JSON asset files.. If those aren't sufficient then look at java reflection to access otherwise private fields and methods. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.