Posted December 11, 20159 yr Does anyone have recommendations for how one might keep a persistent log of player accomplishments (not achievements) both on and offline? For the sake of example, say player "Max" logs onto the server and starts mining. If he were to input a command, upon execution, he would receive such information as his in-game name, the total number of blocks he's mined throughout his time on the server, and really any other accumulated statists relevant to his character; this information, however, should be persistent. I have seen some people recommending use of a hash map for logging and retrieving desired information about players but would the information in the map continue to exist upon a server restart? Would it perhaps be better to keep track of things via text log? If anyone has advice/questions I would greatly appreciate your guidance. Just to clarify, I'm not asking for specifics, just general guidance. – Money can't buy everything but I'd rather cry in a mansion...
December 11, 20159 yr For stuff like this, you generally want to use IExtendedEntityProperties (IEEP). IEEP allows you to assign data to players and save it to player data file. Note that IEEP is only loaded when player is online, but nothing stands in your way to read player.dat yourself (Java IO and CompressedStreamTools). Also note that Vanilla alredy has some stats (I think it does track e.g blocks mined), just saying. Tutrial on IEEP: 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.
December 11, 20159 yr Author For stuff like this, you generally want to use IExtendedEntityProperties (IEEP). IEEP allows you to assign data to players and save it to player data file. Note that IEEP is only loaded when player is online, but nothing stands in your way to read player.dat yourself (Java IO and CompressedStreamTools). Also note that Vanilla alredy has some stats (I think it does track e.g blocks mined), just saying. Tutrial on IEEP: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and Thank you so much for the tip and link. And yea, I was just using that as an example to make a point. – Money can't buy everything but I'd rather cry in a mansion...
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.