How to make a firework explosion appear when an enemy is hit, and with a certain color

Started by Dartrix on

Topic category: Help with modding (Java Edition)

Last seen on 16:44, 2. Mar 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a firework explosion appear when an enemy is hit, and with a certain color

So, i'm making a forge mod for 1.16.5 (I'm making my own SMP with custom items and etc), so the point is that i'm making a bow for a friend that likes the concept of the universe, the moon, dreams, basically universe related stuff.

And he requested a bow, so i made it, but the problem is that, i want to make it so when i hit an enemy with the arrow proyectile shot by that bow it generates a Firework Explosion that is yellow and white, and does AOE damage.

Can i get some help, please?, i've been trying to make this work for soo long, i still have a long way left so i can finish the mod, but everything is looking awesome.

And, thanks.

Last seen on 14:24, 24. Apr 2024
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know if you still…
Mon, 07/03/2023 - 18:52

I don't know if you still need help, but i can provide some for you if you do need it:

#1 - You can't create custom fireworks or spawn them with a procedure block, you need to use commands for this. This page allows generating fireworks with custom color and you can even define if it flickers, the shape, flight duration, etc...
https://www.digminecraft.com/generators/give_fireworks_rocket.php


#2 - You can create AOE damage, but you have to do it via a procedure and attach it to the sword hit local trigger (from the sword itself), or use Global Triggers and check for "entity attacked". Check for your sword, and you can use the "For each entity as [Entity Iterator] at [x] [y] [z] in square cube with size [4]". Here you need to place a "deal damage" block and replace the "Target Entity" block for the "Entity Iterator" one, this will make so every enemy in a 4x4x4 area will take the damage you specified in that previous block. You can then adjust the area, damage value and place the "execute command at" block with the command you generated above. That should give you similar results as what you ask for. Hope this helps!