Posted May 10, 20205 yr I want to detect whether an entity is in a NON-axis aligned plane boundary in front of the player, that rotates with the player's pitch and yaw. I've done the linear algebra and it works. The plane is directly in front of the player, with width 0.6, length 2, and it is 1.6 units above the player's world coordinates and this is my implementation of that. Graphed, this is when I'm directly facing a testificate, in the plane's coordinates. A,B,C are the 3 corners of the plane, and E and D is the coordinates of the bottom and top of the villager, respectively. Another view, from the XY plane: As you can see, it clearly intersects, and graphing where t=1.3 corresponds to in the parametric equation results in the correct intersection (it's F): That said, when I then cancel the vanilla event, and cause damage to the entity in code, nothing happens. Is it possible that when I make that damage call, it calls the same attack event method again, which is then canceled? Disregard, I figured it out the second after I posted it. There was a typecast to int that shouldn't have been there that was setting the flag to false. Also the event is only called for the client. Edited May 10, 20205 yr by Turtledove
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.