Mob with custom range of view 1.17

Started by RandomDudeGamer on

Topic category: Help with modding (Java Edition)

Last seen on 12:37, 30. Mar 2024
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mob with custom range of view 1.17

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

Last seen on 09:42, 5. Sep 2023
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Java code ammma = ammma…
Sat, 01/08/2022 - 09:33

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

Last seen on 12:37, 30. Mar 2024
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks. I forgot about the D…
Thu, 01/27/2022 - 02:00

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.

Last seen on 10:36, 15. Aug 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did anyone find how to do it…
Sun, 07/17/2022 - 12:52

Did anyone find how to do it in 1.17?

Last seen on 12:37, 30. Mar 2024
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think so, go to your…
Sun, 07/17/2022 - 23:15

I think so, go to your Entity.java (After locking the code)

Then scroll to the bottom until you see all the

builder = builder.add(Attributes.BlahBlahBlah = Random Integer);

Stuff (Your mob's health, damage stats). Go to the very bottom of that, and add:
 

builder = builder.add(Attributes.FOLLOW_RANGE, 100);

Change 100 to anything you want, and I think that's the follow range. I'm not 100% sure if this is the way.

Last seen on 10:36, 15. Aug 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it works
Mon, 07/18/2022 - 13:55

it works