Jump to content

[SOLVED] [1.12.2] Modifying player capabilities for offline players?


Differentiation

Recommended Posts

3 hours ago, diesieben07 said:

How is JSON applicable at all here? Capabilities use NBT...

You can probably do something similar to what SaveHandler#readPlayerData does. You can't use it directly, because it requires an EntityPlayerMP. Then you can modify the data and save it back. Note however that you need to take to only do this if the player isn't logged in or your changes will go away.

I mean, it isn't necessarily capabilities that I'm trying to store, it's just raw data (some boolean, integer variables, etc.) and that's what I meant by using JSON.

 

So the way I currently do it is make a temporary entry in my JSON file for offline player. Then when they log on, I move the values to NBT (the player capability class) and remove the JSON entry.

Edited by Differentiation
Link to comment
Share on other sites

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.