1

Mini Game Help - Turns

hogbits's Avatar hogbits6/18/17 4:51 pm
1 emeralds 274 1
7/14/2017 3:49 pm
Cadermate's Avatar Cadermate
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 hogbits's Avatar
hogbits
Level 33 : Artisan Pig
20

Create an account or sign in to comment.

1

1
07/14/2017 3:49 pm
Level 16 : Journeyman Engineer
Cadermate
Cadermate's 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!
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome