How to make a mob tamed by another mob? (Or make a mob follow another?) (Segmented mob)

Started by ItsSnowingSome… on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a mob tamed by another mob? (Or make a mob follow another?) (Segmented mob)

Yes, I know I didn't really word this whole question right, but, I'll try to explain. First of all, I'm actually trying to make a segmented mob using other mobs. I got most things figured out (Health, despawning, so on) , but, I cannot seem to get the segments to follow properly. I can spawn each segments when head mob is spawned, and can despawn them when the head dies. Also, the segment mobs don't need to do or take damage. I am willing to code a bit as well, but, I am not great with java. (I usually code in C#, but, even then I'm not the greatest)

 

Lastly, if this is possible. Is there a way (Maybe with generated NBT tags?) to group all mobs to the head mob? So the segment mobs don't bug out when close to another head mob?

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it should be just as simple…
Mon, 05/10/2021 - 22:43

it should be just as simple as making each different segment entity type follow the nearest segment, with the priority being the head, and have the following offset by however many blocks in size the head/segments are. If one segment is already following the head, then the next segment will detect that and follow that segment instead, etc. 
If you're asking for the following itself, then i'd assume it would just be setlocation of each segment to x y z of followed segment, with an offset depending on where the segment it's following is faced toward.

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks, this does help quite…
Mon, 05/10/2021 - 23:39

Thanks, this does help quite a bit (And, I was asking about the following itself, but, that first part does sound a bit better then what I was planning.) Since it has been awhile since I've used MCreator I'm still a tad confused on how to put the code together, but, I'll figure it out (hopefully). Thank you

Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
just make sure not to have…
Tue, 05/11/2021 - 17:19

just make sure not to have two of whatever entity your making get too close to eachother