Brooo you are in 1.12 why do you made mods on 1.12 in 2024
anyway i have similar issue in 1.20.4 in mi case to fix i have to make the BlockEntity to manually call on blockEntityChanged() to inform the world the block entity has change and need to be saved
// ########## ########## ########## ##########
@Override
protected void saveAdditional( CompoundTag nbt ){
//System.out.println("\n##saveAdditional(), " + this.getBlockPos() );
nbt.put("inventory", itemhandler.serializeNBT() );
nbt.putInt("progress", this.progress );
super.saveAdditional( nbt );
//System.out.println(NbtUtils.prettyPrint(nbt));
this.getLevel().blockEntityChanged(this.getBlockPos()); //<----------
}
but this is in 1.20.4 may theres something equivalent in 1.12