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

Tried things like finding the net-handler, but did not succeed.

What's the best way to do so in 1.11.2? (Ping to the server I'm currently connected to)

 

Thanks!

  • Author
15 hours ago, diesieben07 said:

NetHandlerPlayClient::getPlayerInfo(Minecraft.getMinecraft().player.getGameProfile().getId()) will give you a NetworkPlayerInfo instance, which has getResponseTime.

 

Is there an example code I can see somewhere?

  • Author
2 hours ago, diesieben07 said:

Wasn't that already an example?

 

Not really sure how to use the " NetHandlerPlayClient::getPlayerInfo " part :/ 

NetHandlerPlayClient::getPlayerInfo , you get the netHandler from the EntityPlayerSP (this is inside Minecraft.class) and then you call the getPlayerInfo() methode

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

  • Author
23 hours ago, MCenderdragon said:

NetHandlerPlayClient::getPlayerInfo , you get the netHandler from the EntityPlayerSP (this is inside Minecraft.class) and then you call the getPlayerInfo() methode

 

Can't find it.

Screenshot_2.png

NetHandlerPlayClient  != EntityPlayerSP you wont find getPlayerInfo inside the wrong class. also just look at the fields in the EntityPlayer and check what is a NetHandler

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

  • Author
14 minutes ago, MCenderdragon said:

NetHandlerPlayClient  != EntityPlayerSP you wont find getPlayerInfo inside the wrong class. also just look at the fields in the EntityPlayer and check what is a NetHandler

 

Still can't find it

Screenshot_3.png

Minecraft has not a netHandler, the netHandler is inside the player.

Edited by MCenderdragon

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

  • Author
1 minute ago, MCenderdragon said:

Minecraft has not a netHandler, the netHandler is inside the player.

 

So how can I access it if it's not by using mc.player?

just look at the fields in side the playerSP class there IS somewhere the net handler. if the field is not public there IS somewhere a getter.

Edited by MCenderdragon

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

  • Author
2 hours ago, diesieben07 said:

It is via Minecraft::player.

 

Sorry, what does the :: mean? is it like the Minecraft.getMinecraft(); thing?

 

2 hours ago, MCenderdragon said:

just look at the fields in side the playerSP class there IS somewhere the net handler. if the field is not public there IS somewhere a getter.

 

Is there a playerSP class? could find only the playercontrollerMP class but not this one.

10 minutes ago, Bets said:

Sorry, what does the :: mean? is it like the Minecraft.getMinecraft(); thing?

It means it is a non static field in Minecraft... You can also use # but diesieben likes it more...

Classes: 94

Lines of code: 12173

Other files: 206

Github repo: https://github.com/KokkieBeer/DeGeweldigeMod

  • Author
13 hours ago, diesieben07 said:

EntityPlayerSP player = Minecraft.getMinecraft().player;
NetworkPlayerInfo npi = player.connection.getPlayerInfo(player.getGameProfile().getId());

 

And now you need to go learn Java. Seriously.

 

Oh so this is what you mean, yeah I used that before in my code.

I just did not under stand what the :: and # stuff means xD 

Thank you!

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.