[1.12.2] Custom data reset when user reconnect

Sponge Build: Can’t find it, but latest on github
Forge Build: forge-1.12.2-
Java Version: 8

Hi, I’m getting trouble after updating my plugins to 7.1.0. My custom data are not saved when the player is reconnecting to the server, but when I break on the fillContainer I can see that values are right… if anyone can help me, this can be very good !

Plugin Source: ImmutablePlayer.java · GitHub

You need to actually register the Keys… Just building them doesn’t cut it. I can provide some more debugging on keys when they’re used, but you are building things, but not registering them. That’s the first step to troubleshooting.

I tried to register key with the event methods like :

public void onKeyRegistration(final GameRegistryEvent.Register<Key<?>> event) {

Same issue, but actually I didn’t see anywhere that registering the keys like that. So far i just register my keys with :
registerKeyValue(MyKeys.STANDARD_ID, this::id); registerKeyValue(MyKeys.STANDARD_NAME, this::name); registerKeyValue(MyKeys.STANDARD_LVLPVP, this::lvlPvP); registerKeyValue(MyKeys.STANDARD_HONORS, this::honors); registerKeyValue(MyKeys.STANDARD_ELEMENT, this::element);

First I’ve heard of it. How do you register Keys, and when?

Already have the same issue…