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

Started by Greeper36 on

Topic category: Help with Minecraft modding (Java Edition)

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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.

Active 4 hours ago
Joined Apr 2024
Points:
344

User statistics:

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

are you using the "has active potion" block?

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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

Active 4 hours ago
Joined Apr 2024
Points:
344

User statistics:

  • Modifications: 7
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 425
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

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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))

Active 4 hours ago
Joined Apr 2024
Points:
344

User statistics:

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

what's the global/external trigger?

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

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

When entity attacked

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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

Active 4 hours ago
Joined Apr 2024
Points:
344

User statistics:

  • Modifications: 7
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 425
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)

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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 

Active 17 hours ago
Joined Aug 2024
Points:
71

User statistics:

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

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