spawn lingering potion effect when entity die.

Started by Natsirtelrem on

Topic category: Help with modding (Java Edition)

Last seen on 19:48, 17. Jan 2024
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
spawn lingering potion effect when entity die.

Hello Hello there ! 

i'm making a mod with Monster Hunter toads in and i need to know how to spawn lingering potion when they dies. 
i've found how to spawn the particules but i cant add custom effects. 
i've also tryed to give the "killer entity" / "source entity" effects and it's working but not like i would like. 
to explain a bit more i want:
 when i kill a frog it spawn a lingering cloud with the effect slowness or nausea that can affect all entity that is in contact with the cloud 

ps: sorry for the bad english i'm a frenchie boi ^^

Last seen on 00:46, 5. Dec 2023
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For my mod I plan to create…
Sat, 02/25/2023 - 00:43

For my mod I plan to create the same as you, but I was thinking of implementing it in a different way.

I'm telling you, in case it helps, create an animated block or entity with animation (you can use the geckolib plugin for this) and if it's an entity, set its movement speed to 0 so it doesn't move, then just do that when the player or entity collides with the entity/block it is given the potion effect that you want.

The problem with this is that the area where an entity can be affected depends on the hitbox of the block or entity.
(I recommend a block since you can put the hitbox one block high so the player or entity can move above while if it is an entity then the player could push it as you do in the game to push a chicken xd but it will continue receiving the effect while they are colliding and if you don't want it to break the block then disable it so it can't)

then in the triggers all that remains is for you to do a procedure in which after a certain time the block/entity disappears.

The solution I give you is kind of weird but it's what occurred to me :p

 

pd: If you don't understand what I'm saying, ask and I'll send you screenshots

Last seen on 19:48, 17. Jan 2024
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
personally i solved the…
Sat, 02/25/2023 - 01:05

personally i solved the problem with a procedure block "when entity die" then  "use command:"
i used MCstacker for the command ^^ spawn -> area effect cloud -> Radius 4 -> the effect i want -> the color 

if that can help you ^^ 
i already posted the mod with this solution if u want to see
 

Last seen on 00:46, 5. Dec 2023
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ooh! The truth is that I…
Sat, 02/25/2023 - 02:18

ooh! The truth is that I supposed that there could be a simpler solution than the one I mentioned earlier, but since I was lazy to investigate, I was thinking of leaving it like that xd
Thank you very much for commenting!

Last seen on 19:48, 17. Jan 2024
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
{id:"minecraft:area_effect…
Sat, 02/25/2023 - 12:39

{id:"minecraft:area_effect_cloud",Particle:"entity_effect",Radius:4f,Duration:60,Color:16711680,Effects:[{Id:2,Amplifier:10b,Duration:60},{Id:15,Amplifier:10b,Duration:60}]}


https://mcstacker.net ^^