Posted December 4, 20177 yr 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?
December 4, 20177 yr 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.