forum Forumsplay_arrow Minecraft fiber_manual_record Redstone


Mini Game Help - Turns

1 emerald1 reply194 views
created 06/18/2017 4:51 pm by hogbits
last reply 07/14/2017 3:49 pm
Hey all,
I am having a hard time finding a solution to a problem that I have with a mini game I am working on. It's a turn based game for 2+ players, only I am failing to work out how I can ensure each player takes their turn in order.

* I am writing this as 1.12 functions
* Needs to work for Multiplayer
* Can't break if a player leaves and rejoins the game
* Currently using player tags for "active_turn" and "inactive_turn" for other functions so that tag is already available for manipulation.
* Help as pseudo code also works
Posted by avatar
Level 25 : Expert Pig

comment Login or register to post a reply.

1 reply

07/14/2017 3:49 pm
Level 10 : Journeyman Engineer
Well, you could try re texturing a carrot on a stick and then detecting when the player uses it by setting up a scoreboard command like this: scoreboard objectives add EndTurn stat.useItem.minecraft.carrot_on_a_stick
you could rename the carrot on a stick to End Turn or something like it and when the player finishes their turn they could use the item. You can then use their score of EndTurn inside a target selector like this: @a[score_EndTurn_min=1]
I would also suggest putting each player on a team so you could cycle through each one. This can also be done using scoreboard. If you want it to be automatic, simply put this instead of using a carrot on a stick: scoreboard objectives add EndTurn dummy
You can increase this score to 1 by doing this: scoreboard players add @a[selectors] EndTurn 1
This is probably really confusing, but if you get any of this, than I hope it works!

Planet Minecraft



© 2010 - 2019