Started by
Voxdox
on
Topic category: Help with Minecraft modding (Java Edition)
Hello there. In my mod, MineHanced 1.15.2, I am trying to add an entity, called the Sand Stormer, that spawns in groups of 1 - 4 very far away from the player, and walks toward them slowly. I have attempted to implement the "walking to you from a far distance away" feature and it seems that they only look at the player, not approach them. They only aggro onto me once I approach them. Is there something i'm missing? Workspace and screenshot of procedure are both included. Thank you for the assistance.
Edit: For what ever reason it seems I am not able to add screenshot of procedure and workspace.
Edited by Voxdox on Sat, 07/11/2020 - 22:19
entities usually have a 16 block follow range, so if you're outside that range, the pathfinding and targeting AI won't track you.
Thank you for replying, I appreciate the clarification. By chance would you know how to increase the range above 16 blocks, or is that impossible to do?
it is very possible, but will require some coding.
if your comfy with coding, then in your entity class, find the method registerAttributes(). add a line:
where 40.0D is the distance in blocks you would like your entity to track.
Of course! I didn't even think about that. Thanks a ton!
Hey hey we looking good! Everything is functioning perfectly. Thanks again!
Hey, I am using MCreator 2020.5 with the 1.12.2 addon. I was wondering why the build fails when I do this? Also, why does "follow distance" not do anything?
for 1.12.2 its:
this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(40.0D);
Where can I find registerAttributes()? my entity doesnt have that method for some reason (1.16.4). Where should I insert it and how it should look?
i'm not familiar with 1.16.4. sorry
I found it, if anyone is interested you have to do this
1. find method private void setupAttributes()
2. into the method paste this next to the similar lines: ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 90.0D);
3. change 90,0D to range you like
4. you are done
Im really really new to java modding. Im months late for this but can anyone guide me how can I apply this to my mob? 1.16.5 but I do think?* that the 1.16.4 method will work but where do I find that entity class?
Nevermind! I Finally FOUND IT! THANK YOU Original POSTER as well as MMG! My Shingeki no Kyojin - Titans mod is now completed!
Can someone tell me how can I increase aggrorange of an NPC I am making a boss and i want him to attack players from a far distance if a player hit him with anything from far or in short attack him from far and the boss will go to the player and attack the player please tell me my version is 1.7.10 and i used it script in int this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(40.0D) but it showed some missing space after numeric literal
Please help me