Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Adapting objectMouseOver() method's logic to use server side data.
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
SecondAmendment

Adapting objectMouseOver() method's logic to use server side data.

By SecondAmendment, March 26, 2017 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

SecondAmendment    0

SecondAmendment

SecondAmendment    0

  • Stone Miner
  • SecondAmendment
  • Members
  • 0
  • 81 posts
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

Share this post


Link to post
Share on other sites

The_Fireplace    11

The_Fireplace

The_Fireplace    11

  • Creeper Killer
  • The_Fireplace
  • Forge Modder
  • 11
  • 241 posts
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

Share this post


Link to post
Share on other sites

HashtagShell    5

HashtagShell

HashtagShell    5

  • Stone Miner
  • HashtagShell
  • Members
  • 5
  • 94 posts
Posted March 31, 2017

We already discussed this. You will need to write your own code.

 

  • Quote

Share this post


Link to post
Share on other sites

jabelar    593

jabelar

jabelar    593

  • Reality Controller
  • jabelar
  • Members
  • 593
  • 3266 posts
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/

Share this post


Link to post
Share on other sites

HashtagShell    5

HashtagShell

HashtagShell    5

  • Stone Miner
  • HashtagShell
  • Members
  • 5
  • 94 posts
Posted March 31, 2017

This is so very much exploitable with clientside mods...

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Draco18s
      GUI Documentation

      By Draco18s · Posted 25 minutes ago

      GUIs aren't that difficult. There's dozens of tutorials for them and they haven't really changed all that much in ten years.
    • Xenfo
      Mod Blocker

      By Xenfo · Posted 41 minutes ago

      Any mod blockers that actually work? Please link them if yes.
    • diesieben07
      Tessellator ignores lighting?

      By diesieben07 · Posted 1 hour ago

      Neither 1.10 now 1.14 are supported here. Please refer to the supported versions page: https://forums.minecraftforge.net/topic/91712-supported-version-directory/
    • CookieLukas
      Tessellator ignores lighting?

      By CookieLukas · Posted 1 hour ago

      Oh,  sorry, the code was 1.10.2, but as its not allowed here, I updated it to 1.14.4.
    • diesieben07
      Forge isn't working on Minecraft Realms

      By diesieben07 · Posted 1 hour ago

      1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • T1ps
      3
      GUI Documentation

      By T1ps
      Started Tuesday at 10:14 PM

    • Xenfo
      0
      Mod Blocker

      By Xenfo
      Started 41 minutes ago

    • CookieLukas
      3
      Tessellator ignores lighting?

      By CookieLukas
      Started 2 hours ago

    • Extrodonary
      1
      Forge isn't working on Minecraft Realms

      By Extrodonary
      Started 1 hour ago

    • Liahim
      0
      [1.16.4-1.16.5] Seed for Biome Provider and Chunk Generator

      By Liahim
      Started 1 hour ago

  • Who's Online (See full list)

    • bananapizzuh
    • Xenfo
    • Warsade
    • monkeysHK
    • Microcellule
    • Draco18s
    • ChampionAsh5357
    • philip-elsner@gmx.net
    • Beethoven92
    • Mango106
    • Luis_ST
    • Liahim
    • diesieben07
    • Mounty
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Adapting objectMouseOver() method's logic to use server side data.
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community