I need some way to save a certain data on the vanilla bed (like last slept player UUID). Currently I try to write NBT to a BedBlockEntity via mixin of BedBlock injecting into onUse method.
Unfortunately, it works only once per session, since relogging into the game rather deletes the bed with no warnings/errors in the runtime log, or leaves non rendered block, without a block entity.
So, what might be the cause of relogging issue and why just writing NBT to a vanilla block entity doesn't work? Is there is a better way to do it than mixining BedBlockEntity?
Thank you very much!