How to make an entity attack any other entity if it has a potion effect.

Started by 0NullVoid0 on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 weeks ago
Joined Feb 2024
Points:
134

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 28
How to make an entity attack any other entity if it has a potion effect.

So, I'm trying to make my entity attack any other entity but only if that entity has a targeting effect, but can't find out how because there's no way (as far as I know) to check the entity that will be targeted in attack conditions. please help, thx.

Active 1 day ago
Joined Apr 2024
Points:
405

User statistics:

  • Modifications: 8
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 470
on the entity tick update…
Fri, 05/02/2025 - 21:49

on the entity tick update trigger: https://ibb.co/XrB7NkXR replace jump boost with the effect you want, 20 is the range of the entity, you can set it to any number

Active 2 weeks ago
Joined Feb 2024
Points:
134

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 28
thx, I'll try that.
Fri, 05/02/2025 - 23:53

thx, I'll try that.

Active 2 weeks ago
Joined Feb 2024
Points:
134

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 28
works well, except for if…
Sat, 05/03/2025 - 13:49

works well, except for if theres two enemies with the effect on opposite sides of the specific entity, but otherwise it works really well, thx!

Active 2 weeks ago
Joined Feb 2024
Points:
134

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 28
thx, I'll try it.
Mon, 05/05/2025 - 20:37

thx, I'll try it.