The rule you are alluding to with respect to a television set is called the "first sale doctrine" which basically prohibits copyright and trademark owners from limiting the ability of a buyer of a good (like a CD or authorized logo T-Shirt) protected by copyright or trademark, from limiting further sales of that good (or the manner in which the good is used by its new owner) after a first retail sale of the good with copyright or trademark protections.
This doctrine was derived from an old common law rule that invalidated "restraints on alienation" of property other than intellectual property on public policy grounds, and like the "restrain on alienation" rule for tangible property, the first sale doctrine that applies to intellectual property was also (at least originally) a court created common law rule.
But Minecraft isn't, conceptually, a good. It is a continuing service provided over the Internet, and firms that provide continuing services on a licensed basis, as Minecraft does, can impose terms of service (a.k.a. an "end user license agreement" a.k.a. EULA) which must be complied with in order for users to be allowed to continue to utilize the service. So, its prohibition on exchanges of things of real world value for things of game value, except as the terms of service authorize, is permitted.
A user of Minecraft is more analogous legally to someone skating at an ice rink than to someone who buys a CD or book. If you buy a ticket to skate at an ice rink, the people granting you the license to use the ice rink have the right to set rules governing how you utilize that service, and to terminate your license if you don't follow the rules (e.g. by skating in the wrong direction at the wrong time). Indeed, a ticket to an event is also known in legal parlance as a form of "license" just like a EULA, and licenses to use real property are the origin of the body of law that now governs the licensing of intangible intellectual property.
A Minecraft license isn't something that you own (even if you have a license of unlimited duration), it is a qualified and limited right to use something that someone else owns, that you aren't allowed to purchase, but you are allowed to use on the owner's terms.
How can they enforce servers to follow that rule if the server's are
not using Mojang's proprietary software.
The EULA or TOS obligation in the Minecraft business model is enforceable because Minecraft isn't in the business of selling proprietary software, even though it does do that. Minecraft is in the business of licensing access to data and online resources. The EULA regulates your access to the data on servers, and the computing power of those servers, not your ownership of an app which facilitates your use of the licensed services.
And, while there are various contractual remedies for violating a EULA, the most basic one is a self-help remedy: to cut you off from your ability to use the service if you violate the owner's rules.
Indeed, at least heuristically, the easiest way to distinguish an intellectual property good, which is subject to the first sale doctrine, from an intellectual property service, which can be licensed pursuant to a EULA, is whether, as a practical matter, the firm distributing the intellectual property has a practical ability to deny you service going forward without resort to the courts.
If the owner of the intellectual property has no practical ability to do that, the intellectual property being distributed will probably be classified as a good and be subject to the first sale doctrine.
But, if the owner of the intellectual property has the practical ability to cut you off from the intellectual property being distributed without resort to the courts, the intellectual property being distributed will probably be classified as a service, which is not subject to the first sale doctrine and may be licensed.