I've seen some people expressing interest in the process behind mod development. Having started proper mod making in 2013, I can tell some things about that. So here goes something.
==============================================================================
Currently trying to make a mob that can go through blocks. Initial success was achieved after several hours, after figuring out how collision works in the game. Had to make custom path processor, path finder and navigator, as well as rewrite collision code of this particular mob. Now there remains a bug - this mob navigates only horizontally, which means that if he starts path at a block above ground and then descends, he tries to reach the end point which remains set in the air, thus he repeatedly jumps back and forth trying to reach the point. I guess I need to adjust it so the endpoint creates lower when this mob descends.
Another issue I can see is ascending. As it is now, the mob won't ascend, because he can just run through blocks. What if he has to attack a target that stands higher? The pathfinder must be adjusted so he can ascend blocks without going inside them, and collision code must be in sync with this. Quite a complicated task, eh?
*******************************************************************************************************************
Another thing I'm trying to make is an experience storage block. The vanilla code "shines" here. We have three variables related to exp: an integer named "experienceLevel" which stores amount of levels, a float "experience" which stores partial level (the one reflected by green bar in the HUD), and an integer "experienceTotal", which stores total experience amount, including partial level. Like, what the ...? There are 2 functions in player class which deal with exp - one that adds an arbitrary amount of exp, and one which adds an arbitrary amount of levels. The first function is overriden in EntityMP subclass (server-side player), where it sets some suspicious variable "lastExperience" to -1. Digging through code, it appeared that this variable is used to synchronize exp values to client-player. Not going too much into details, I've made a block which can deposit/credit all exp. at once, because that shiz is too complicated for me to handle. There remains an issue with synchronization, e.g. after exp. was deposited, the player still has it, hidden. No wonder there aren't many things that deal with experience, as its system was written so wonky. I'm thinking of just stealing exp conversion formulas from open-source mods, there is no point in reinventing the wheel and dealing with crap-code.
==============================================================================
Currently trying to make a mob that can go through blocks. Initial success was achieved after several hours, after figuring out how collision works in the game. Had to make custom path processor, path finder and navigator, as well as rewrite collision code of this particular mob. Now there remains a bug - this mob navigates only horizontally, which means that if he starts path at a block above ground and then descends, he tries to reach the end point which remains set in the air, thus he repeatedly jumps back and forth trying to reach the point. I guess I need to adjust it so the endpoint creates lower when this mob descends.
Another issue I can see is ascending. As it is now, the mob won't ascend, because he can just run through blocks. What if he has to attack a target that stands higher? The pathfinder must be adjusted so he can ascend blocks without going inside them, and collision code must be in sync with this. Quite a complicated task, eh?
*******************************************************************************************************************
Another thing I'm trying to make is an experience storage block. The vanilla code "shines" here. We have three variables related to exp: an integer named "experienceLevel" which stores amount of levels, a float "experience" which stores partial level (the one reflected by green bar in the HUD), and an integer "experienceTotal", which stores total experience amount, including partial level. Like, what the ...? There are 2 functions in player class which deal with exp - one that adds an arbitrary amount of exp, and one which adds an arbitrary amount of levels. The first function is overriden in EntityMP subclass (server-side player), where it sets some suspicious variable "lastExperience" to -1. Digging through code, it appeared that this variable is used to synchronize exp values to client-player. Not going too much into details, I've made a block which can deposit/credit all exp. at once, because that shiz is too complicated for me to handle. There remains an issue with synchronization, e.g. after exp. was deposited, the player still has it, hidden. No wonder there aren't many things that deal with experience, as its system was written so wonky. I'm thinking of just stealing exp conversion formulas from open-source mods, there is no point in reinventing the wheel and dealing with crap-code.