Jump to content

How to shoot a falling block from the player's position?


Rex_Technology

Recommended Posts

I'm trying to make an item that when I right click it a falling block shoots from the position of the player, in the direction where the player is looking but, I tried 

FallingBlockEntity fallingBlock = FallingBlockEntity.fall(event.getLevel(), event.getPos(), Blocks.DIRT.defaultBlockState());

and setting the delta movement to the look angle of the player but the falling block just falls from the players feet to 2 block and then disappears and reappears near as a full block on a block near the crosshair. I don't know what to do.

Link to comment
Share on other sites

7 hours ago, Rex_Technology said:

and setting the delta movement to the look angle of the player but the falling block just falls from the players feet to 2 block and then disappears and reappears near as a full block on a block near the crosshair. I don't know what to do.

The falling block only has logic for...falling. If you want it to do something else, you need to program the movement logic for it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.