Jump to content

Proper Ray Trace after Block Break


Recommended Posts

Hey all! I am trying to get a proper ray trace to receive a MovingObjectPosition with what angle I broke a block at. I am subscribing to the forge event: BlockBreak. But, it seems like when this event is called, the block is already disappeared so the ray trace is return the stats of a block that is no the block that was removed. How can I get the ray trace INSIDE the BlockBreak event of the Block that I just broke.


Thanks in advance! :D

Link to comment
Share on other sites

In the BlockEvent (the class that BreakEvent extends) is a EntityPlayer object which you can get the angles from.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.


1.12 -> 1.13 primer by williewillus.


1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.



Link to comment
Share on other sites

I'm not sure if you properly understand the issue. I have the EntityPlayer, but the problem I am having is doing a rayTrace BEFORE the BlockBreak event, inside of the event call. In other words, when the event is called and the block is broken, I then need to get what side of the block the Player was looking at BEFORE the break was called. Right now, the rayTrace is being called AFTER the block is broken, so the trace is pointing me towards a block that was behind the block that was just broken.


I hope that cleared up any confusion and I appreciate the response :)

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.

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.