How Do You Make Flying Mobs Follow You When Holding an Item Using Code

Started by Matt The Banana on

Topic category: Help with modding (Java Edition)

Last seen on 00:53, 14. Mar 2024
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How Do You Make Flying Mobs Follow You When Holding an Item Using Code

I have a flying mob that copies the AI of a bat and I can't set items up for it to follow. I want to make the mob follow you if you are wearing a certain armor or/and you are holding any type of melon item/block. I don't have any experience with coding in Java and I was wondering how to do this. I want the mob to follow you similarly to how bees do but I am using 1.14.4 and I don't think that there is an option for base AI like a bees. Any help is appreciated.

Last seen on 09:43, 1. Jun 2022
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make "On Entity Tick Update"…
Thu, 08/26/2021 - 14:23

Make "On Entity Tick Update"

If player holds an item, execute the command in the name of "Event/Target Entity": /tp @s ^ ^ ^0.5 facing entity @p