how can i make a laser gun?

Started by RoboTDragon on Thu, 09/10/2020 - 18:24

Topic category: Help with modding (Java Edition)

Last seen on 21:21, 19. Oct 2020
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
how can i make a laser gun?
Thu, 09/10/2020 - 18:24

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 14:02, 14. Oct 2020
Joined Jun 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 21:21, 19. Oct 2020
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 21:21, 19. Oct 2020
Joined Jul 2020
User points:

User statistics:

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

maybe a turtoral if you can?

thanks