Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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? 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.