how can i make a laser gun?

Started by RoboTDragon on

Topic category: Help with modding (Java Edition)

Last seen on 05:09, 8. Jan 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how can i make a laser gun?

I was thinking of a high velocity ranged weapon with a particle trailing trail falling behind it but there's always big gaps between particle an another can anyone help me?

like a fully charged bow has one, but i want drip_lava particle 

Last seen on 16:47, 29. Oct 2023
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When making guns for a mod,…
Thu, 09/10/2020 - 21:16

When making guns for a mod, I decided not to use high-velocity ranged weapons, and to do it with code instead. This way, I had much more control over what could and couldn't happen. Here's how:

1. I made a gun item that would trigger a procedure when it was right clicked.

2. I edited the code of the procedure, with the built in code editor in MCreator

3. I made it so when triggered, the code would create a bounding box, and using a loop, move it in the direction the player was looking.

4. If the bounding box hit a mob, block, or went too far, it would trigger an action, such as damaging the hit mob or spawning impact particles on the block it struck.

This is basically a lazar gun, because it fires in a completely straight line the player is looking in. All you would have to change, is to spawn a lava particle every time the bounding box is moved by a little. Hope it helps!

Last seen on 05:09, 8. Jan 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
might help but i sounds…
Fri, 09/11/2020 - 14:26

might help but i sounds pretty asvanced

and i never really did anything with the code editor

Last seen on 05:09, 8. Jan 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
maybe a turtoral if you can?…
Fri, 09/11/2020 - 22:02

maybe a turtoral if you can?

thanks