TransWikia.com

'/testfor' a number more than 0

Arqade Asked by Caleb Woodman on August 13, 2020

I am making a points shop for kills. I have the objectives money and kills. When I press a button, a command block tests for my kills (hopefully) above 0, and if that is a thing, it takes gives me one money and takes one kill. But this never happens because it always “Finds” me, and now my kills are in the negative.

TLDR: How to /testfor a number only above zero?

One Answer

A good way to do this is to have it when you press the button, for something costing 3 'points', have a command block with the command /testfor @p[score_TEST_min=3] This will make it so the minimum score you can have is 3. So, if your score is smaller than 3, it can't take away points.

Remember, it can be any number, just substitute the number 3 for the number of points something costs. Lead a redstone comparator out of that command block, and to the command blocks that take the 3 points away from you, and give you the item(s). (I'm assuming you already have the commands for these, if you don't, leave a comment, and I will add them.)

Answered by ALX on August 13, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP