Topic category: Help with Minecraft modding (Java Edition)
I am trying to create a lightning beam / particle line effect in MCreator.
BLOCK TO: İN CUBE ENTİTY
My goal is:
- When a lightning bolt strikes a specific block, all mobs within about 15–20 blocks are detected.
- Each mob takes damage.
- At the same time, a visible electric beam (made from particles) should appear from the struck block to every affected mob.
I do not want a single particle at the start and end. Instead, I want a continuous line of particles that looks like electricity or a laser beam connecting the two points.
Currently, I am using linear interpolation (LERP) to calculate positions between the block and the mob.
For every step:
t = step / maxSteps
px = blockX + (mobX - blockX) * t
py = blockY + (mobY - blockY) * t
pz = blockZ + (mobZ - blockZ) * t
Then I spawn a particle at (px, py, pz).
This creates many particles along the path, forming a continuous beam between the block and the target mob.
I am looking for tutorials, examples, or discussions related to this technique.
Possible keywords:
- MCreator particle line
- MCreator beam effect
- MCreator lightning beam
- MCreator laser particle
- MCreator particle trail between entities
- MCreator draw particles between two points
- MCreator entity to entity particle
- Minecraft spawn particles along line
- Minecraft particle beam
- Minecraft lightning beam effect
- Minecraft particle interpolation
- Minecraft linear interpolation particles
- Minecraft ray particle effect
- Forge particle line
- Forge lightning beam effect
- Spawn particles along line
- Linear interpolation (LERP)
- Interpolation between two points
- Entity-to-entity particle beam
Essentially, I want to know the best way to create a continuous particle beam between a block and an entity in MCreator or Minecraft modding.
make it summon particles ig idk
For particle line, use some simple math. There are even forum topics explaining particle shape math.
If you want to render a beam, use e.g. https://mcreator.net/plugin/120961/vfx-photon-effects
you could do this by making a custom projectile that has a particle trail, but i understand that would not help with the connecting lighting bolts, so i made this procedure that shoots a particle beam from the player's look angle, maybe you can workshop it into your lightning beams?
The amount of loops determines the length of the beam and the amount added to beammodifier each loop determines how close the particles are to eachother, i hope this helps
open image in new tab to see it better ^
@pepper realy thanks, but you can share the ptpl file for me?
here is the ptpl file
https://github.com/PepperProductions/beam.git
remove the +1.7 from the y coordinate if you dont want it shooting from player eye level
https://imgur.com/a/ndMzUVA it's isn't working correct, but i try something.
i'm try gonna shoot projectile block...
Good News! i made a plugin for this :D (for 2024.4 neoforge and its my first plugin btw)
İMAGEim make this eng and upload this on mcreator. its works perfect, cooming soon...