Minecraft Blogs / Tutorial

Command Blocks Part 1: Minigames - Use the XP bar as a timer

  • 2,777 views, 2 today
  • 2
  • 0
  • 1
BestVestInTheWest's Avatar BestVestInTheWest
Level 58 : Grandmaster Taco
27
Uses for Command Blocks

Part 1:
Minigames

Use the XP bar as a timer

First, you will need to type out this command

/scoreboard objectives add XP dummy

Ok, now place one command block down with a button

Put in the command block:
/scoreboard players set @a XP 1

Now, place another command block behind it

Put in the command block:
/xp 60L @a
(change 60 to whatever you want your time in seconds)

That's your firing mechanism.

Make a timer like this one
undefined




Start up the timer

Add a command block on the redstone side

Put in the Command Block:
xp -1L @a[score_XP_min=1]

Put another Command Block on the redstone side

Put in the Command Block:
testfor @a[score_XP_min=1,xp=0]

Behind that Command Block, put a comparator

Put a Command Block in front of the comparator

Put in the Command Block:
scoreboard players reset @a XP

After that, put anything behind that, put something like /say GAME OVER. That is your output

This is what it should look like

undefined

Leave a diamond if you think this was helpful!
More is comming

-Gravity Burger
Tags

Create an account or sign in to comment.

1
04/06/2017 6:05 pm
Level 49 : Master Goblin
HueyRRuckus
HueyRRuckus's Avatar
I got this timer working...but I can not figure out where to put the out put on this thing. Can you help me with that?
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome