1
I am currently making a Minecraft Apocalyptic Adventure Map where the air is toxic and you must wear a gasmask, and I was just wondering how I would make it work.
I need to have a command that when you take off your gasmask, you start to take damage, and when you have it on, you don't. Also, there are some bunkers and places with breathable air, which you will be able to remove it freely.
I have played some space adventure maps where this happens, so I know it's possible, but I have no idea what command/s I would need to use.
Can somebody help me?
Also, I'm making custom shops in it, and I know how to make it take something from your inventory and give you the item, but I DON'T know how to make it NOT give it to yu if you don't have enough.
Help, please?
I need to have a command that when you take off your gasmask, you start to take damage, and when you have it on, you don't. Also, there are some bunkers and places with breathable air, which you will be able to remove it freely.
I have played some space adventure maps where this happens, so I know it's possible, but I have no idea what command/s I would need to use.
Can somebody help me?
Also, I'm making custom shops in it, and I know how to make it take something from your inventory and give you the item, but I DON'T know how to make it NOT give it to yu if you don't have enough.
Help, please?
Create an account or sign in to comment.
3
1
On a commandblock clock:
This will give every player who isn't wearing an iron helmet with the name "Gas Mask" the wither effect (if you don't know how to /give items with a custom name, just ask). You can of course change the item and the name to your liking. Advantage of this method over the one mentioned before is that it works properly with multiple people.
Which method you use is up to you, but keep in mind that the wither effect can kill people while the poison effect can not.
scoreboard players tag @a[tag=mask] remove mask
scoreboard players tag @a[tag=!mask] add mask {Inventory:[{id:minecraft:iron_helmet,Slot:103b,tag:{display:{Name:Gas Mask}}}]}
effect @a[tag=!mask] minecraft:wither 1 0
This will give every player who isn't wearing an iron helmet with the name "Gas Mask" the wither effect (if you don't know how to /give items with a custom name, just ask). You can of course change the item and the name to your liking. Advantage of this method over the one mentioned before is that it works properly with multiple people.
Which method you use is up to you, but keep in mind that the wither effect can kill people while the poison effect can not.
1
If your advanced enough, and you could testfor the player in a certain area, than that could activate this
But take out the orange, this will look for a player with the helmet on, once its off you could use a redstone torch activating a repeating command block giving poison for 1 second (It will be on repeat until the torch is off)
/testfor @p {Inventory:[{Slot:103b,id:"minecraft:IDNAME",tag:{display:{Name:"CUSTOMITEMNAME"}}}]}
But take out the orange, this will look for a player with the helmet on, once its off you could use a redstone torch activating a repeating command block giving poison for 1 second (It will be on repeat until the torch is off)
1
I could try to explain all of this, but it would be a very long post. I can give you this link which has some awesome command block tutorials, and feel free to PM me if you still need help.
http://jragoncommands.weebly.com/tutorials.html
http://jragoncommands.weebly.com/tutorials.html