Posted March 26, 20178 yr How can I adapt the objectMouseOver() method's logic to use server side data. in order to get the entityHit that a player looks at and use it server side. Edited March 26, 20178 yr by SecondAmendment
March 31, 20178 yr Depends. Is it just that you need to use server-side data for something on the client? Or are you actually trying to have the server do something? If what you want is the former, I would use packets to request the information from the server and have it sent back to the client. If you want the latter, I would look in to using LivingUpdateEvent, check if the entity is a player, and write code similar to Entity::rayTrace() (A client only method, which is why you would need to recreate something similar) to determine if the player is looking at an entity. Edited March 31, 20178 yr by The_Fireplace If I helped please press the Thank You button. Check out my mods at http://www.curse.com/users/The_Fireplace/projects
March 31, 20178 yr You might want to check out my tutorial where I create a weapon with extended reach. In that case I had to find the entity that mouse was pointing at and tell server to process an attack. As mentioned above, the key is to have client send the information to server with custom packet message. My tutorial is here: http://jabelarminecraft.blogspot.com/p/minecraft-modding-extending-reach-of.html Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.