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

I was just wondering, I have an event that is a ClientConnectedToServerEvent because I couldn't find any better event that gets when the player connects to the server. I need to get the world the player joins when this event fires, how do I do this?

  • Author
4 minutes ago, diesieben07 said:

1.8.x is old, update.

There is PlayerLoggedInEvent.

That only runs for singleplayer as far as I can tell. I cannot get it to run when joining a multiplayer server.

 

And you don't know what my mod is about or what it does. It has to be in 1.8.9.

  • Author
Just now, diesieben07 said:

The event fires on the server, not on the client. Do you need a client event? If so, why?

 

The content of the mod does not change anything about the Minecraft version. 1.8.9 is old and outdated and no longer receives updates. It will soon be unsupported on this forum.

I need to have it so that when a player joins a server it gets a player list of the world they are currently in.

  • Author
1 minute ago, diesieben07 said:

There is no reliable way to do that, the client only knows all players that are in tracking range. Could you describe what you are trying to achieve?

I have a MySQL database that has a list of usernames in it. When the mod user connects to a server I want it to check through all the players and see if they are in the database.

  • Author
14 minutes ago, diesieben07 said:

Where is this database hosted? What should happen when they are in the DB?

Why does it matter?

  • Author
1 minute ago, diesieben07 said:

Because that depends on how you implement this. If the client doesn't have access to the DB (which is likely) this must be done on the server.

Ok, then how do I do it on the server?

  • Author
Just now, diesieben07 said:

It depends. What are you trying to do when the name is in the DB?

It sets a value in the main class to true, which does something else.

  • Author

The mod is made so that people can use a command to add a username to the database. When the mod user joins a server it loops through everyone on the server and then if it finds someone with a username in the database it displays some text on the screen that they are in the database for a few seconds.

 

https://hastebin.com/gocegupiko.swift = Join class

https://hastebin.com/uhuxajapec.php = Name checker

https://hastebin.com/kaqocaqelo.cs = SQL Connection thing

  • Author

Yes, I know what a class and field is. If I try NetHandlerPlayClient.playerInfoMap it throws errors because it doesn't exist.

  • Author
3 hours ago, diesieben07 said:

What for?

So I know what to do, so far none of our conversation on this thread has helped me

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.