Is there a way to shoot projectiles from a block?

Started by superProxi64 on

Topic category: Help with modding (Java Edition)

Last seen on 16:11, 8. Jun 2022
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a way to shoot projectiles from a block?

This may have already been answered by someone else, so if that is the case, please let me know.
I made a cannon block in BlockBench, and I wanted to make a system where if the player presses right click on it with a cannonball in their inventory, then the cannon will shoot. The problem is that I do not know how to make a projectile shoot out of a block. Does anyone know how to do this?
Also, not required but would be nice, is there a way to shoot a projectile from a block at a specific angle? (reference image below)

Cannon reference image

Last seen on 00:59, 19. Oct 2022
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know how to do it if…
Tue, 05/04/2021 - 22:34

I know how to do it if instead of a block it would be an entity
so you can adjust the angle of where it looks
I could make an entity with that model, you would make it not move.
and not be able to take damage

Last seen on 16:11, 8. Jun 2022
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay. Thank you for helping!
Wed, 05/05/2021 - 00:12

Okay. Thank you for helping!