Mob atack condition on right click

Started by Spidey0042 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mob atack condition on right click

how do I get a tame mob to start and stop attacking when I right-click on it? I tried to do it myself but as it is my first mod all my attempts ended up crashing the game :/

Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is no way to add…
Sat, 07/10/2021 - 00:03

There is no way to add additional data to mob AI (and create advanced AI with more than one lines of behavior), so the only way - create a copy of mob with another AI and create procedure that will despawn agressive (attacking) mob and replace it with his peaceful version, and call it than right click on mob.

Look this for more info: https://www.youtube.com/watch?v=8bXr9Y9G5HM