What I'd suggest is for you to use the Galacticraft mod. However, if you still want to achieve an atmosphere effect, it is possible. The catch is, you have to manually deploy 'safe zones', and it won't be possible to detect leaks unless you set it to detect blocks broken from a pre-placed ship.
Actually, you could try using Structure blocks for that, but since they aren't released, I won't cover it.
Firstly, you'll want to setup an invisible armor stand to act the center of your "safe zone".
/summon minecraft:ArmorStand ~ ~ ~ {CustomName:"OxygenField",Invisible:true}
Place them around the places you want to have "oxygen".
Next, create a scoreboard to keep track of how long a player has strayed from an oxygen field (within range of a armor stand named "OxygenField").
/scoreboard objectives add timeSinceOxygenField dummy Time since the player was in a oxygen field
Next, we'll want three clocks; one to reset the player's score while he/she is in an oxygen field, one to damage the player when they're outside a oxygen field after a set amount of time and a third to increase the timer regardless.
Set these commands to preferably run on a 1 second clock. You can go slower/faster if you want, just make sure not to go too quickly otherwise your game/server may become unresponsive.
/scoreboard players add @a timeSinceOxygenField 1
/execute @e[name=OxygenField] scoreboard players set @a[r=5] timeSinceOxygenField 0
/effect @a[score_timeSinceOxygenField_min=10] minecraft:wither 1 2 true
Of course, you can change the variables to achieve different effect. Right now, on a 1 second timer, this will:
- Start damaging players after 5 seconds and,
- Apply a wither effect that will remove 1/2 hearts per second.
EVA needs to be pretty much impossible without armor, which I will cleverly rename "Space suit."
Just make a scoreboard objective to test whether the player has a 'space suit' equipped and modify your damage command to not affect anyone with a 'space suit' on.
How can I simulate losing air from a vacuum? As in, I poke a hole in the ship, and problems start to occur until I close it, not from any obvious source.
That may not be possible in the current version (1.9) of Minecraft. However, you can achieve the same effect by testing for each block in a structure. If one of them is broken, simply remove the armor stand that represents the oxygen field.
If your ships are moving, things are obviously going to get more complicated.