How to make: Shoot the Block in front of Player

Started by TheRedstoneWolf on

Topic category: Help with modding (Java Edition)

Last seen on 17:27, 7. May 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make: Shoot the Block in front of Player
Sat, 04/27/2024 - 14:35 (edited)

Basically, I just want the block you click on to float up briefly and then be shot in the direction the player is facing. The shot block should damage every entity it hits. If it collides with blocks, it should disappear. I have found a way to shoot blocks and make them do damage, but it has its problems and is not perfect.

My way:

 

Float up the block:

Shoot block:

The vector block in “Shoot block”:


There are two more procedures that 1. check “on player tick update” and 2. check “on loaded entity tick update” if there is an entity of the type fallingblock nearby and then do damage to itself.

 

Is there a better way? If custom code is the solution, I would be very pleased to receive an example.

 

Edited by TheRedstoneWolf on Sat, 04/27/2024 - 14:35