The reviveCaps() worked for me. I'm using forge 37.0.67.
My Clone Event:
public static void onDeath(PlayerEvent.Clone event) {
if (event.isWasDeath()) {
event.getOriginal().reviveCaps();
event.getOriginal().getCapability(ModCapabilityImpl.MOD_CAPABILITY).ifPresent(oldStore -> {
event.getEntity().getCapability(ModCapabilityImpl.MOD_CAPABILITY).ifPresent(newStore -> {
newStore.copyForRespawn((ModCapabilityImpl) oldStore);
});
});
event.getOriginal().invalidateCaps();
}
}
In my IModCapability:
void copyForRespawn(ModCapabilityImpl oldStore);
In my ModCapabilityImpl:
@Override
public void copyForRespawn(ModCapabilityImpl oldStore) {
this.value = oldStore.value;
}
Hope this helps!