How to "Get Potion Effect of target entity" In Trigger

Started by Raxiore1972 on

Topic category: Help with modding (Java Edition)

Last seen on 03:36, 1. Mar 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to "Get Potion Effect of target entity" In Trigger
Tue, 06/20/2023 - 11:19 (edited)

Hi, I'm developing a dinosaur mod.

The dinosaur that I'm developing has to use the ability to give the potion effect that dinosaur have it to the surrounding entitys.

However, I don't see a block that gets potion effect that target entity have it.

If there isn't a block that does this, how to solve it?

 

 

 

Edited by Raxiore1972 on Tue, 06/20/2023 - 11:19
Last seen on 19:29, 11. Apr 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So to reiterate, you're…
Wed, 06/21/2023 - 01:06

So to reiterate, you're wanting the following.

A procedure that grabs the potion effect the dinosaur has and apply it to all entities in a block radius nearby.

Couple questions, is the dinosaur having the same potion effect every time or will it have different effects depending?

What causes the other entities to be affected? There needs to be a trigger for this procedure to take place, does the dinosaur attack the other entities which is what inflicts it or is it just based on a timer every x amount of ticks?

More information would be helpful.

Last seen on 03:36, 1. Mar 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This dinosaur using any type…
Thu, 06/22/2023 - 10:52

This dinosaur using any type of potion effect from a potion bottle thrown by a player 

Last seen on 05:10, 3. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Using procedures, I don't…
Sat, 06/24/2023 - 14:22

Using procedures, I don't think there's any good way to do this, as potions are selected from a drop-down menu, so you wouldn't be able to create one piece of code that works for every potion. The best way to do this that I found would be to create one block for each potion, which unfortunately is time consuming and wouldn't include potions from other mods :(

Here's what I personally would do for the effect:

https://imgur.com/PnMbcvw

On Entity Tick Update (for your dinosaur) -> Test for the potion being used -> For each entity in the area -> Test if they already have the potion (lock-out) -> If they do not have the potion, set the lock-out to true, add the effect to entity -> wait for the remainder of the potion effect -> set lock-out to false, so you can have new potions applied to the entity

This could probably be done without the lock-out as well, but since it's applying on every tick, it may glitch without it (I haven't tested this, so it may work perfectly fine)

I hope this helps :)

Last seen on 03:36, 1. Mar 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hm thank you but i cant…
Wed, 06/28/2023 - 12:38

hm thank you but i cant understand

i tryed that but nothing worked