Topic category: Help with Minecraft modding (Java Edition)
Hi there, in my java code for my mob, I have inputted the following:
if (this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE) != null)
this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(80.0D);
This should overwrite the default value of 16 blocks for follow range. This mob seems to stop following after the player moves 16 blocks away. I am using the latest MCreator snapshot version (2020.5 b35716). I have tried summoning my mob manually with /summon with a different specified follow_range with no effect.
/summon zombiex:zzombie ~ ~ ~ {Attributes:[{Name:"generic.follow_range", Base:100.0}]}
Additional Info: Behavior is set to Mob, Entity base is set to None with AI programming using the 'aggressive against player' preset, mob natural spawning is set to ambient, as I am trying to test around to get an enemy that can spawn in the daytime, evening, and night in various locations. If anyone has advice or tips on how to make a zombie-like mob that chases the player for extremely long ranges, let me know if I'm doing something wrong!
EDIT: Solved. I didn't notice prior, I thought it was my own fault with forgetting to save, but every time I edited the mob file, the code would get reset removing the changes to my follow range attribute in the code and I had to re-add it. Oopsies! I'm silly.