"Minecraft" offers cross-platform play for both versions of the game — Bedrock and Java — but you can only play with users ...
You can add friends in "Minecraft" through their Microsoft account's gamertag, regardless of which platform they use to play the game.