I'm trying to run some minigames and such made with command blocks. The only problem is that I want to set certain things, for example in this situation Checkpoints, to where only certain people with certain tags on them can do certain things. I COULD just set their spawnpoints there and have a kill button for them to tp there, but I don't want them to be dying since they will respawn at the hub instead of in the area of the minigame and I have given them Regen and Saturation which will reset on death.
Therefore I'm trying to set up a system where when a person touches a pressure plate, it tells the game they have a score of 1 which means they can use a different button to tp back to that point as a checkpoint. If they have a score of 0 then the button won't allow them to tp. I have no clue how the hell to do this. I've tried execute and giving them items and etc and etc... I HAVE NO CLUE! Somebody please give me a suggestion on how to do this!!!
The Meaning of Life, the Universe, and Everything.
Join Date:
12/29/2014
Posts:
45
Minecraft:
GGFreshest
Member Details
If the map is Singleplayer, then when they step on a pressure plate, just have an armorstand named CurrentCheckpoint or something teleport to them at that location. Every time they hit a pressure plate, teleport that same armorstand to their location. When they do whatever causes them to return to a checkpoint, teleport the player to the CurrentCheckpoint armorstand.
(before everything)
/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"CurrentCheckpoint"} -optional to add CustomNameVisible:1b
On the other hand, if this is multiplayer, you can have a series of armorstands on each checkpoint with names like Checkpoint1 and Checkpoint2 etc... Then, test every armorstand for a player in a radius. If there is a player, set that player's score to the corresponding number. When the death/checkpoint event is triggered, then teleport the player to the corresponding armorstand
(before everything)
/scoreboard objectives add Checkpoint dummy
(on each checkpoint)
/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"Checkpoint1"} - Optional CustomNameVisible:1b again
/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"Checkpoint2"} <--- only change that number inside the quotes
repeat the ^^above^^ for every checkpoint
(repeating command block while current minigame is active)
/execute @e[type=armor_stand] ~ ~ ~ /scoreboard players set @a[r=2] Checkpoint [respective checkpoint number here]
(non conditional chain command blocks after reapeating command block)
Thanks so much! This helped a lot. You did leave a few things that weren't specified well and I didn't understand them at first such as how the execute command for the multiplayer solution can't work properly unless you specify the name of the armor stand. Otherwise every single armor stand will set players to that score.
The only other thing I'd like to ask is if there is a way to set the armor stand entity's real name and then give them a Display name. Like with the objectives command where you can set a name to use in commands when specifying objectives but a display name for players in the game:
What I want to do is have multiple parkour areas with each one displayed as Checkpoint [#] for each checkpoint in that area with the same thing applying to any further areas. So is there someway I can give an armor stand a name to identify in commands and then one that is displayed to players?
I kind of get what your saying, but the only problem is that requires one armor stand to be used in the commands and still another to be displayed. This still makes it where there are multiple display name armor stands which will have the same names.
I kind of get what your saying, but the only problem is that requires one armor stand to be used in the commands and still another to be displayed. This still makes it where there are multiple display name armor stands which will have the same names.
That won't work, but thanks for the suggestion.
except an armor stand's custom name doesn't show if you do... something. I forget what it was.
I'm trying to run some minigames and such made with command blocks. The only problem is that I want to set certain things, for example in this situation Checkpoints, to where only certain people with certain tags on them can do certain things. I COULD just set their spawnpoints there and have a kill button for them to tp there, but I don't want them to be dying since they will respawn at the hub instead of in the area of the minigame and I have given them Regen and Saturation which will reset on death.
Therefore I'm trying to set up a system where when a person touches a pressure plate, it tells the game they have a score of 1 which means they can use a different button to tp back to that point as a checkpoint. If they have a score of 0 then the button won't allow them to tp. I have no clue how the hell to do this. I've tried execute and giving them items and etc and etc... I HAVE NO CLUE! Somebody please give me a suggestion on how to do this!!!
have you tried using target selector arguments? @p[score_thing=1,score_thing_max=1,x=?,y=?,z=?] (or something like that)
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
If the map is Singleplayer, then when they step on a pressure plate, just have an armorstand named CurrentCheckpoint or something teleport to them at that location. Every time they hit a pressure plate, teleport that same armorstand to their location. When they do whatever causes them to return to a checkpoint, teleport the player to the CurrentCheckpoint armorstand.
(before everything)
/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"CurrentCheckpoint"} -optional to add CustomNameVisible:1b
(on pressure plate)
/tp @e[type=armor_stand,name=CurrentCheckpoint] @p
(on death/back to checkpoint event)
/tp @p @e[type=armor_stand,name=CurrentCheckpoint]
On the other hand, if this is multiplayer, you can have a series of armorstands on each checkpoint with names like Checkpoint1 and Checkpoint2 etc... Then, test every armorstand for a player in a radius. If there is a player, set that player's score to the corresponding number. When the death/checkpoint event is triggered, then teleport the player to the corresponding armorstand
(before everything)
/scoreboard objectives add Checkpoint dummy
(on each checkpoint)
/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"Checkpoint1"} - Optional CustomNameVisible:1b again
/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:"Checkpoint2"} <--- only change that number inside the quotes
repeat the ^^above^^ for every checkpoint
(repeating command block while current minigame is active)
/execute @e[type=armor_stand] ~ ~ ~ /scoreboard players set @a[r=2] Checkpoint [respective checkpoint number here]
(non conditional chain command blocks after reapeating command block)
On death event:
/tp @a[score_Checkpoint_min=1,score_Checkpoint=1] @e[type=amor_stand,name=Checkpoint1]
/tp @a[score_Checkpoint_min=2,score_Checkpoint=2] @e[type=amor_stand,name=Checkpoint2] <---- changing all of the numbers to respective checkpoint
If you have any issues with this, or have other specifications, lemme know, but otherwise, hope this helps
Thanks so much! This helped a lot. You did leave a few things that weren't specified well and I didn't understand them at first such as how the execute command for the multiplayer solution can't work properly unless you specify the name of the armor stand. Otherwise every single armor stand will set players to that score.
The only other thing I'd like to ask is if there is a way to set the armor stand entity's real name and then give them a Display name. Like with the objectives command where you can set a name to use in commands when specifying objectives but a display name for players in the game:
/scoreboard objective add [real name] dummy [Display name]
/scoreboard objective add pvpscore dummy "~ Monsters Slain ~"
What I want to do is have multiple parkour areas with each one displayed as Checkpoint [#] for each checkpoint in that area with the same thing applying to any further areas. So is there someway I can give an armor stand a name to identify in commands and then one that is displayed to players?
Ex:
armor_stand {name=parkour01checkpoint3,displayname="Checkpoint 3"}
you could use two armor stands, and hide the one used in commands by setting it to invisible.
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
I kind of get what your saying, but the only problem is that requires one armor stand to be used in the commands and still another to be displayed. This still makes it where there are multiple display name armor stands which will have the same names.
That won't work, but thanks for the suggestion.
except an armor stand's custom name doesn't show if you do... something. I forget what it was.
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!