[Solved] How to agro enemies when eating a specific item

Started by ZarephLae on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Solved] How to agro enemies when eating a specific item
Tue, 03/12/2024 - 00:12 (edited)

2023.3

So I'm basically trying to make it so neutral enemies will immediately agro the player when he eats a specific food item I made. I tried setting my procedure up like this.

https://i.imgur.com/1fNd4Dh.png

But in this example, wolves don't attack me when eaten. My thought was, maybe the game doesn't think the player is the target entity? So I wanted to change it so it says source entity. But you can't use source entity with "when player finishes item". Which defeats my purpose I'm trying to go after.

P.S. The global trigger is not the issue, the procedure is linked through the items "when item is finished" so it is not needed to be specified in the global trigger.

Edited by ZarephLae on Tue, 03/12/2024 - 00:12
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're using a pretty small…
Sat, 09/30/2023 - 01:47

You're using a pretty small radius. A square cube with size 7 will only effect entities within 3.5 blocks of the player. (The 'break out of loop' might also be a problem; it it doesn't immedieately find a wolf, it might be prematurely ending the procedure. You should be able to safely remove that.) Otherwise, your code looks correct. It may just be that wolves, being neutral mobs, can't be forced to target the player. (Though Iron Golems are also neutral, and I haven't had issues changing their attack targets in the past.)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're right Mindthemoods, I…
Sat, 09/30/2023 - 16:51

You're right Mindthemoods, I thought 7 was the block radius but I guess it's calculated as half blocks. I bumped it up to 16 and it worked perfectly. Thanks.