SecondAmendment Posted March 26, 2017 Posted March 26, 2017 (edited) 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, 2017 by SecondAmendment Quote
The_Fireplace Posted March 31, 2017 Posted March 31, 2017 (edited) 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, 2017 by The_Fireplace Quote If I helped please press the Thank You button. Check out my mods at http://www.curse.com/users/The_Fireplace/projects
HashtagShell Posted March 31, 2017 Posted March 31, 2017 We already discussed this. You will need to write your own code. Quote
jabelar Posted March 31, 2017 Posted March 31, 2017 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 Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
HashtagShell Posted March 31, 2017 Posted March 31, 2017 This is so very much exploitable with clientside mods... Quote
Recommended Posts
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.