I'm creating a custom map/minigame that requires at least 2 players. The lobby button should have the effect of teleporting everyone to the kit choice room, but I want it to only teleport people if there are at least 2 players. How can I create a mechanism that teleports players if there are at least 2 players to teleport?
I tried that, except it didn't work. Why? Because the comparator stayed on. The next time I pressed the button, nothing happened because the comparator was still on. I've tried this method already, but it doesn't work.
I tried that, except it didn't work. Why? Because the comparator stayed on. The next time I pressed the button, nothing happened because the comparator was still on. I've tried this method already, but it doesn't work.
Comparators will stay on until the SuccessCount of the command block they are hooked up to turns to 0. This can be done with the blockdata command, simply run it when the comparator gets powered:
blockdata x y z {SuccessCount:0}
Just replace x y z with the coordinates (absolute or relative) of the command block you want to reset, and you should be good to go.
Rollback Post to RevisionRollBack
I like to do redstone builds on my channel, and I can probably help you with your in game troubles.
Create a scoreboard that counts how many people are in the room IE when a person joins it puts a tally on that scoreboard then test for a minimum on that scoreboard objective... I'm not 100 percent sure if this will be the easiest way to do it but I know you can test for a minimum tally with scoreboard objectives because I have a tally count in my new map with a reputation system I am making... You could make it as simple as put up a button that says " click to join this match" then when they click the button it will add them to the tally and when you have a minimum of 2 than start a count down or something and then have it teleport all the people that are in the tally to the other room...
Yes, SuccessCount is exactly what I need. I'll try that now. However, the Darkjuggalo2000, the scoreboard idea won't work. When players leave the server/LAN, it won't remove their scoreboard value. This can seriously screw things up.
Yes, SuccessCount is exactly what I need. I'll try that now. However, the Darkjuggalo2000, the scoreboard idea won't work. When players leave the server/LAN, it won't remove their scoreboard value. This can seriously screw things up.
Ahhh.. This is true did not think about that.
I wonder if you can test for how many people are on a team? then when they left the count would go down...
-
View User Profile
-
View Posts
-
Send Message
Curse Premium(comparator)
tp @a x y z
Using the count selector parameter (c) should work, I think.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffIt will not. The 'count' parameter only lowers the maximum number of players to select, and there is no 'minimum' variant.
Comparator signal strength can be used instead. The more players found, the stronger the signal.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumComparators will stay on until the SuccessCount of the command block they are hooked up to turns to 0. This can be done with the blockdata command, simply run it when the comparator gets powered:
blockdata x y z {SuccessCount:0}Just replace x y z with the coordinates (absolute or relative) of the command block you want to reset, and you should be good to go.I like to do redstone builds on my channel, and I can probably help you with your in game troubles.
Check out Lets Play awesomeness www.youtube.com/AricaraGames
Subscribe to my youtube channel! www.youtube.com/Darkjgaming
Ahhh.. This is true did not think about that.
I wonder if you can test for how many people are on a team? then when they left the count would go down...
Check out Lets Play awesomeness www.youtube.com/AricaraGames
Subscribe to my youtube channel! www.youtube.com/Darkjgaming
Well, that was simple yet very effective.
My Youtube Channel https://www.youtube.com/user/bongotezz
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumVery true, when the player count is just two, that makes a lot of sense. People seem to think in command blocks rather than redstone these days.
You also can use this for more than 2 player.
two pressure plate is just a trigger.
You can tp them all when two of them press the plate
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumyeah, but if you needed 3 players at least, you'd need 2 and gates. That's what I meant.