Invisibility Detection (SOLVED)

Started by BryAstro on

Topic category: Help with modding (Java Edition)

Last seen on 10:54, 26. Jul 2024
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Invisibility Detection (SOLVED)
Sun, 12/17/2023 - 12:10 (edited)

I would like to make an item that when holding it, it gives ONLY invisible enemies the glowing effect. I already know how to give all entities glowing effect, but I would like to know how to only give the invisible entities the glowing effect within a certain radius, no other entity should be affected by this.

 

Version 2023.3

Edited by BryAstro on Sun, 12/17/2023 - 12:10
Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You should use an entity…
Mon, 12/11/2023 - 12:24

You should use an entity iterator to target all entities within a radius, (I assume this is what you were already doing), but add an if bracket that checks if the entity iterator has an active invisibility potion before applying the glowing effect. You could even make the duration of the glowing effect equal to the remaining ticks of the entity iterator's invisibility effect, so that it wears off as soon as the entity is no longer invisible.

Last seen on 10:54, 26. Jul 2024
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thx so much for helping me!…
Tue, 12/12/2023 - 00:50

Thx so much for helping me! I was able to do it! :)