-1

I am making a space station.

This is a problem in and of itself in every way. All aspects of the game will have to be tweaked in vanilla minecraft to make this anywhere near realistic. Today's question from the confuddled command block lover:

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.

  • The damage source must be slow, not instantaneous.
  • The damage source must start affecting the player pretty much as soon as a hole gets poked in the ship.
  • The source must get at a player anywhere in the ship not sealed off, because duh.
  • It needs to work from any direction, including up and down.
  • The source must be invisible, so mobs could work, but not, say, lava.
  • EVA needs to be pretty much impossible without armor, which I will cleverly rename "Space suit."
  • We'll assume for convenience that any regular damage can be called suffocation.
  • Nobody needs to leave the ship or enter a zone to take the damage.
3
  • 1
    There is a mod that covers this: galacticraft
    – OrangeDog
    Mar 20, 2016 at 11:33
  • 2
    Mod != map. The OP isn't asking "Is there a mod that does this?", he's asking "How do you do this with command blocks?" Mar 20, 2016 at 16:15
  • 2
    @sharpturn I know, that's why I made a comment instead of an answer.
    – OrangeDog
    Mar 28, 2016 at 8:23

3 Answers 3

0

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.

0

To detect when a block is broken, simply set a fast clock to detect if a block is broken in the player's stats with the following command:
/testfor stat.MineBlock.(typeofblock) true
Then, set this up on a toggle switch that would begin a clock. A clock that would (every 4 seconds or so) trigger a resistance effect of the player within a certain range by using the following command:
/effect @a[r=range in blocks] 11 1 [effect level]
And, with a repeater, damage them with
/effect @a[r=range in blocks] 7 1 1 This is just sort of a an "equation" for this tweak, and you may have to do a bit more research on your own.

3
  • I like that, but wouldn't stopping it require somthing else? just placing a block to stop it wont help, because it could be placed anywhere, instead of patching the hole. How could you stop that? Mar 21, 2016 at 17:28
  • What if you threw something out of the opening to patch it, and it would detect a dropped item (because it's an entity) that's away from it. And then it would use a clone command and clone a fixed space station (at least a certain sector of it). Now, it may get rid of certain blocks that were not originally in the station (or room) but that could simulate the vacuum sucking the items into space. Mar 23, 2016 at 21:38
  • This question is still very much open. This does effectively cover the first part, damage when you break the outside, but only just that player and never mind on the no matter where they are part. Not the second part at all, the part where a repair of any kind fixes the problem.
    – anon
    Mar 23, 2016 at 23:07
-1

1.9:Outside the spaceship, repeadetly summon invisible colliding entities,kill them when they reach "x" age and execute them to effect nearby players with wither/whatever effect.

1.8:Dunno.

You must log in to answer this question.