How to make mobs orbit around a certain mob?

Started by BryAstro on

Topic category: Help with Minecraft modding (Java Edition)

Active 23 hours ago
Joined Mar 2022
Points:
600

User statistics:

  • Modifications: 1
  • Forum topics: 35
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 59
How to make mobs orbit around a certain mob?

Version 2024.2 (1.20.1 Forge)

Hello, I would like to know how to make Mob As orbit around Mob B when they are close to Mob B.

https://imgur.com/a/jQj4Jza This is a simple diagram of what the desired result is.

Any help would be appreciated. 

Active 2 weeks ago
Joined Jun 2024
Points:
75

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 37
Try this…
Wed, 10/30/2024 - 17:36

Try this.... PlanetAOnInitialSpawn 

This makes an entity orbit another entity in a circular motion using yaw. SO far the only issue I found with this is since its on the initial spawn trigger of planet A doesn't call it again when u leave and join back. U can prob fix this by doing something similar on tickupdate trigger. I recommend making the second entity have no gravity and a low bounding box so it doesn't hit anything that could mess up the motion. Hope this helps. 

It should look like this btw...https://i.imgur.com/u9UGj73.mp4 

Active 23 hours ago
Joined Mar 2022
Points:
600

User statistics:

  • Modifications: 1
  • Forum topics: 35
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 59
How would I make the orbit…
Thu, 10/31/2024 - 06:24

How would I make the orbit radius larger?

Active 23 hours ago
Joined Mar 2022
Points:
600

User statistics:

  • Modifications: 1
  • Forum topics: 35
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 59
Also how can I make the mobs…
Thu, 10/31/2024 - 06:39

Also how can I make the mobs orbit around at different times so they dont all get clumped together (or even seperating them equally)

Active 2 weeks ago
Joined Jun 2024
Points:
75

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 37
https://www.mediafire.com…
Thu, 10/31/2024 - 17:59

https://www.mediafire.com/file/g405abluizsfc7a/orbit.ptpl/file

Try this. All u need to do is change the distance variable to change the distance. Also for the separation I simply just made separate variables(yaws) and then add to them for a separate look.