Jump to content

Recommended Posts

Posted

Hi Guys, I'm new to creating minecraft mods with Forge and to these forums. I've been working on a mod and needed a way to know when the player is joining the server and if this was their first time on the server. I couldn't find a way to do this with the FML player joining hooks, so I wrote my own events. Should I put the code up here or is their some formal method I missed?

 

Description

  • Adds three event classes (PlayerJoinEvent with is extended by PlayerJoiningEvent and PlayerJoinedEvent) and modifies the NetLoginHandler to fire PlayerJoiningEvent and PlayerJoinedEvent events.
  • The PlayerJoiningEvent occurs just before the player connects and gain their entity. It is cancelable allowing mods to deny particular players if they so choose before they fully connect to the server.
  • The PlayerJoiningEvent fires after they join once they have their associated EntityPlayer (which you can access).
  • As mentioned earlier, both have a boolean flag that it true if they are returning and false if this is their first time on the server.

Posted

Or you could check a players nbt tag when they join and if the have a certin tag the don't do something, and if they don't have the tag then do something and write the tag to the player

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

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.