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

IExtendedEntityProperties is your friend.

PlayerTickEvent is another.

SimpleNetworkWrapper (packets) is 3rd (if you want client-side to be able to view his data).

 

How to:

Implement IExtendedEntityProperties to EntityPlayer in EntityConstructingEvent.

Put time in there.

In PlayerTickEvent get his IEEP and increment time by one.

 

Tutorials:

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and

1.7.10 is no longer supported by forge, you are on your own.

  • Author

IExtendedEntityProperties is your friend.

PlayerTickEvent is another.

SimpleNetworkWrapper (packets) is 3rd (if you want client-side to be able to view his data).

 

How to:

Implement IExtendedEntityProperties to EntityPlayer in EntityConstructingEvent.

Put time in there.

In PlayerTickEvent get his IEEP and increment time by one.

 

Tutorials:

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and

 

Okay. And PlayerTickEvent is called once a tick right? (20x a second)

Yuup, also - IEEP is added (should be) on EntityConstructingEvent, which is server AND client. (You can have it only on server if you want)

Same goes for PlayerTickEvent (yes, 20 per 1sec). Remember to check side.

 

If you would like to actually update client with server data (packets) - don't waste one packet per tick per player.

Rather send initial time and then increment this initial time on client side and maybe resynchronize once in a while.

 

See http://www.minecraftforge.net/forum/index.php/topic,27401.0.html (this long (my) post) about more stuff regarding synchronization.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Yuup, also - IEEP is added (should be) on EntityConstructingEvent, which is server AND client. (You can have it only on server if you want)

Same goes for PlayerTickEvent (yes, 20 per 1sec). Remember to check side.

 

If you would like to actually update client with server data (packets) - don't waste one packet per tick per player.

Rather send initial time and then increment this initial time on client side and maybe resynchronize once in a while.

 

See http://www.minecraftforge.net/forum/index.php/topic,27401.0.html (this long (my) post) about more stuff regarding synchronization.

 

Nope. I don't need stuff on the client. I was just planning on interfacing through commands. Now, how does one get the IExtendedEntityProperties of an offline player?

 

I also have this issue when the player logs out, apparently there's two of them?

 

Code: http://pastebin.com/zSUBWnYa and http://pastebin.com/wPui5vKv

"Nope. I don't need stuff on the client."

You can add your PlayTimeData only for server-side PlayerEntities (!world.isRemote).

But watch out - make sure you won't be getting this IEEP on client (null).

 

"get the IExtendedEntityProperties of an offline player"

Impossible, IEEP is loaded with EntityPlayer's NBT, you would need a custom loader (copy vanilla code) that would load offline data.

You will need to translate nick to UUID (quite hard one, you can use cache file maybe for logged in player - similar to one Dedicated server has). Then get UUID.dat and read it using (de)compression tools.

 

"issue when the player logs out"

Yeah, if you register IEEP for client and server there will be 2, one for each. Client one is never saved to NBT, only virtual stuff to store data received from server.

 

1.7.10 is no longer supported by forge, you are on your own.

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.