Posted November 27, 20213 yr I know about Minecraft.hitResult, but that is client-sided. How may I get the block the player is looking at from the server?
November 27, 20213 yr i'm pretty sure there is a better solution for this, but you could do your stuff on client then send a custom packet to the server Edited November 27, 20213 yr by Luis_ST
November 27, 20213 yr Author 2 hours ago, Luis_ST said: i'm pretty sure there is a better solution for this, but you could do your stuff on client then send a custom packet to the server I am doing this so players can't cheat.
November 27, 20213 yr You could calculate it from the player's eyePos and his looking angle. I'm pretty sure you can get both on the server. But if you need to do this like every tick it could be resource intensive and lag the game Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
November 27, 20213 yr Author 1 hour ago, OutCraft said: You could calculate it from the player's eyePos and his looking angle. I'm pretty sure you can get both on the server. But if you need to do this like every tick it could be resource intensive and lag the game How so? A couple of trigonometric functions can't possibly affect performance.
November 27, 20213 yr The problem's about ray tracing and network packets every tick 0.0 Edited November 27, 20213 yr by poopoodice
November 27, 20213 yr Author 20 minutes ago, poopoodice said: The problem's about ray tracing and network packets every tick 0.0 I am not sure I follow. I will only need to get the block position very rarely. How is this a problem?
November 28, 20213 yr We were talking about doing that every tick. You don't have to worry about it then since it's not a big issue anyways.
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.