I can't test for an entity to have a specific effect

Started by Greeper36 on

Topic category: Help with modding (Java Edition)

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can't test for an entity to have a specific effect

I can't test for an entity to have a specific potion effect, I've tried everything I've read on other forums and even my own stuff but it doesn't work! Please help I am genuinely losing it.

Last seen on 05:56, 14. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
are you using the "has…
Sat, 08/17/2024 - 01:56

are you using the "has active potion" block?

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tried that, didn't work,…
Sat, 08/17/2024 - 01:59

I tried that, didn't work, but as I JUST STATED I tried any other way I could find

Last seen on 08:49, 14. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
can you tell me what's the…
Sat, 08/17/2024 - 02:01

can you tell me what's the exact procedure you tried? Or at least when you want to test if the entity has the effect

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm trying to test if the…
Sat, 08/17/2024 - 02:07

I'm trying to test if the entity doesn't have an effect, so I've tried using an if with: Not(Has (entity target) active potion [effect]),

Not((Get effect amplifier of potion[effect] for (entity target))>(0)), Not((Get remaining ticks of potion [effect])>(0))

Last seen on 05:56, 14. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what's the global/external…
Sat, 08/17/2024 - 02:12

what's the global/external trigger?

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do you mean what happens…
Sat, 08/17/2024 - 02:17

Do you mean what happens when the 'if' is true? If the entity has an item in their mainhand or is an entity type of my custom entity, it will give the entity an item

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The problem is that even…
Sat, 08/17/2024 - 02:21

The problem is that even when I'm certain the entity has the effect, it's still giving me the item

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When entity attacked
Sat, 08/17/2024 - 02:24

When entity attacked

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The custom entity gets the…
Sat, 08/17/2024 - 02:39

The custom entity gets the item in it's mainhand only when the mob doesn't have the effect but when you use the item it doesn'y work

Last seen on 05:56, 14. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It seems like it is a…
Sat, 08/17/2024 - 02:45

It seems like it is a problem of the trigger entity attacked, but I found a solution using before entity is hurt

 

https://imgur.com/8owJBps (of course I used conduit power and play sound as an example)

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thats not helpful, when I…
Sat, 08/17/2024 - 02:48

Thats not helpful, when I use the item, it ignores that the entity has the effect and keeps giving me items, but the custom entity doesn't ignore the code 

Last seen on 22:43, 13. Sep 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I changed the trigger to …
Sat, 08/17/2024 - 02:51

I changed the trigger to 'Before entity is hurt' and that works