Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

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


Differentiation
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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
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.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I don't much about this, but I do know you can't use the fog for this. The fog is designed to limit the player's view distance, e.g. if they are in lava or water, but mainly so the game doesn't have to draw all the way to "infinity". This means all the fog rendering code is based on the distance to camera. It's an illusion, it's not based on something physically in the world at some position.   Spit balling: I would guess you want something more like how clouds are drawn? But again these are partially an illusion. They are procedurally generated rather than being physically in the world, but they are kind of drawn at a location. You can use forge's RenderLevelLastEvent to draw over the world. Look at LevelRenderer.renderClouds() for how clouds are drawn.  
    • Problem with Electrodynamics. Talk to the mod author.
    • here is my github if you want to check what I did https://github.com/Socrateee/Mist
    • Hi, i'm trying to create a sort of  toxic "mist" in minecraft wich will be cleared by a machine. To create my mist I modified minecraft RenderSystem using the setShaderFogStart and End and setShaderFogColor methods and the EntityViewRenderEvent from forge to update it. The final idea is to make the block create  a protective sphere where there is no toxic mist. What I've done from now is to apply the toxic fog effect to the player when he leaves a sphere i defined (center : 10 100 10 in the World, radius = 10 blocks ). Here is how it looks : https://imgur.com/WdAhF3D (inside the sphere) https://imgur.com/PcluWul (outside the sphere)   The reason why i'm posting here is because I have a problem that I can't solve : as you can see in the picture 1, when inside the fog clear zone the player can see clearly through the sphere's border wich makes no sens as the outsides of the sphere is supposed to be toxic. What I would like to do is to make the outside of the sphere look the same as when we are outside of it (I hope what I say makes sense, English is not my native language ), how can I achieve that ? Maybe modifing the fog center effect to be centered on the sphere center (10 100 10 ) instead of the player itself ? Is it possible ? Do you think about an another way accomplishing what i descibed ?  I really hope what I said made sense and that I made a correct description of what i want to accomplish Have a nice day !    
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.