Jump to content

Recommended Posts

Posted

Hello! I am just getting started w/ Forge API and am looking to register the amount of clicks the client does and put that on a display (I believe this is possible), as well as register their ping to the server and have it update every 5 seconds (would ticks be more efficient?). How shall I go about this? 

Posted

What have you tried so far?  

 

Obviously what you want to do requires being able to do the following:

1) Create a mod -- have you actually built a mod yet (even one that doesn't do much) that runs without errors?

2) Detect when mouse clicks happen. To do this you should look up how to handle events, in particular mouse-related ones.

3) Draw something on a screen. Anything that gets drawn on the screen is essentially a GUI. If you want it overlayed while playing then you probably want to handle the RenderGameOverlayEvent.Post event.

4) Get the network ping. This can be obtained (at least this was the code in last version I tried) with a somewhat convoluted series of getters: Minecraft.getMinecraft().getNetHandler().getPlayerInfo(Minecraft.getMinecraft().thePlayer.getUniqueID()).getResponseTime()

 

Other than that, you should know there are 20 ticks per second in Minecraft. 

 

Lastly, hopefully you know enough about programming to be able to create the counting fields.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.