Guest User

Minecraft Command Voting System

a guest
Nov 27th, 2022
1,843
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | Source Code | 0 0
  1. Part 1:
  2. execute store result score .red vote if entity @a[scores={vote=1}]
  3. execute store result score .blue vote if entity @a[scores={vote=2}]
  4. execute store result score .green vote if entity @a[scores={vote=3}]
  5. execute store result score .yellow vote if entity @a[scores={vote=4}]
  6.  
  7. Part 2:
  8. scoreboard players operation .max vote = .red vote
  9. scoreboard players operation .max vote > .blue vote
  10. scoreboard players operation .max vote > .green vote
  11. scoreboard players operation .max vote > .yellow vote
  12.  
  13. Part 3:
  14. execute if score .max vote = .red vote run tag @a[scores={vote=1}] add won
  15. execute if score .max vote = .blue vote run tag @a[scores={vote=2}] add won
  16. execute if score .max vote = .green vote run tag @a[scores={vote=3}] add won
  17. execute if score .max vote = .yellow vote run tag @a[scores={vote=4}] add won
  18. scoreboard players operation .choice vote = @a[tag=won,sort=random,limit=1] vote
  19. tag @a remove won
  20.  
  21. Part 4:
  22. execute if score .choice vote matches 1 run say Picked Red!
  23. execute if score .choice vote matches 2 run say Picked Blue!
  24. execute if score .choice vote matches 3 run say Picked Green!
  25. execute if score .choice vote matches 4 run say Picked Yellow!
  26. scoreboard players reset * vote
Advertisement
Comments
Add Comment
Please, Sign In to add comment