How to add server in Minecraft 1.12.2 in Xbox One?

Short answer: you can't.

The new better together update allows cross-platform play, but only between the Xbox One S, Xbox One X, Android, iPhone, iPad, Apple TV, Windows 10, Windows Phone, Amazon Fire tablets, Gear VR and eventually the Nintendo Switch edition.

NOTE: When it says Windows 10 it means the Windows 10 Edition, which is different from the Java version for PC/Mac.

As Augustas said, you can't play in a friends world if he is not active. However, if you or a friend purchases a realms subscription, it will be perpetually available so long as you keep paying the fee. ($3.99/mo. for up to 3 simultaneous players, up to $7.99/mo. for up to 11 simultaneous players). Only one person needs to pay this fee - all friends play free. If you want something akin to a Java edition server, this is as close as you can get.

Also, just since you didn't mention it in your question, you do need an Xbox Live Gold membership to be able to access Realms on Xbox One, though it is not needed for other versions.


I am running 3 servers using phantom and I can join them with Xbox One. phantom can be run on Linux, Raspberry Pi or Windows.

Description:

phantom makes hosted Bedrock/MCPE servers show up as LAN servers, specifically for Xbox. You can now play on remote servers (not Realms!) on your Xbox with friends. It's like having a LAN server that's not actually there, spooky.

How does this work?

On Minecraft platforms that support LAN servers, the game will broadcast a server ping packet to every device on the same network and display any valid replies as connectable servers. This tool runs on your computer - desktop, laptop, Raspberry Pi, etc. - and pretends to be a LAN server, acting as a proxy, passing all traffic from your game through your computer and to the server (and back), so that Minecraft thinks you're connected to a LAN server, but you're really playing on a remote server. As soon as you start it up, you should see the fake server listed under LAN and, upon selecting it, connect to the real Bedrock/MCPE server hosted elsewhere.

For an optimal experience, run this on a device that is connected via ethernet and not over WiFi, since a wireless connection could introduce some lag. Your game device can be connected to WiFi. Your remote server can be running on a computer, a VM, or even with a Minecraft hosting service.