1

Mini Game Help - Turns

1 emerald 1 reply 143 views | started 06/18/2017 4:51 pm by hogbits
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.

FWIW:
* 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
hogbits
Level 22 : Expert Pig
17

1 reply

1
07/14/2017 3:49 pm
Level 4 Apprentice Engineer
Cadermate
avatar
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!

Search

Browse

Site

© planetminecraft.com

Welcome