Started by
Greeper36
on
Topic category: Help with modding (Java Edition)
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.
are you using the "has active potion" block?
I tried that, didn't work, but as I JUST STATED I tried any other way I could find
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
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))
what's the global/external trigger?
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
The problem is that even when I'm certain the entity has the effect, it's still giving me the item
No, I meant to what trigger is the procedure set? in this block: https://imgur.com/iX2QP5b or in this tab: https://imgur.com/FDNI2j4
When entity attacked
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
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)
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
I changed the trigger to 'Before entity is hurt' and that works