Started by
RandomDudeGamer
on
Topic category: Help with Minecraft modding (Java Edition)
So I used to know how to change the range of view for mobs in 1.16, but then I think a lot of things changed in 1.17. Does anyone know how to change the range of view for mobs, so they can see more than 16 blocks far?
In 1.16, it used to be:
ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 900);
But in 1.17, does anyone know what it is, and where to put the code?
Thanks
Java code
ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 120.0D);
1.16
this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(40.0D);
1.12
I am guessing 1.17+ will be different but the keyword to look for is "Attributes". I have not worked with anything above 1.16.
Chew
Thanks. I forgot about the D at the end for 1.16.5. But the 1.17 seems completely different. There's new files in 1.17, and I don't even know which file the code is supposed to be. I tried looking a bit, but I can't seem to find it.
Did anyone find how to do it in 1.17?
I think so, go to your Entity.java (After locking the code)
Then scroll to the bottom until you see all the
Stuff (Your mob's health, damage stats). Go to the very bottom of that, and add:
Change 100 to anything you want, and I think that's the follow range. I'm not 100% sure if this is the way.
it works