Minecraft /testfor shop help
I need help to fix this command. I have tried but it does not work in 1.9
The command is testfor @a[r=3,score_GameTokens_min=5] > give @p cooked_porkchop 3 | /scoreboard players remove @p[r=3] GameTokens 5.
When i try it says Invalid stuff and expected { as first char.
If you can fix this I would greatly appriciate it. I already tried changing it a few times and I searched online but there was none so I had to make a new thread.
Best Answer
You'll likely want to use an impulse block with the following command (thanks @Skylinerw for reducing the command!):
/give @p[r=3,score_GameTokens_min=5] cooked_porkchop 3
Followed by an always active unconditional chaining command block:
/scoreboard players remove @p[score_GameTokens_min=5] GameTokens 5
You'll want to make sure that @p always targets the right player - integrating a temporary dummy objective to trace the player who's buying might be beneficial here, if you need help with that, ask another question on the main site.
Pictures about "Minecraft /testfor shop help"



How do you use Testfor in Minecraft?
How to Enter the CommandWhat replaced the Testfor command in Minecraft?
The /testfor command became obsolete in Minecraft 1.13, and has been replaced by the /execute command*. It will do the same as typing /testfor @e {SelectedItem:{id:"<item>"}} and then putting a comparator to the command block with the command, and then running the command which you wanna run.Minecraft Redstone Tutorial | How to use testfor commands in MCPE!
More answers regarding minecraft /testfor shop help
Answer 2
Try using a comparator.
First command block:
/testfor @a[r=3,score_GameTokens_min=5]
Then use a comparator followed by a repeater going to 2 command blocks:
/give @p cooked_porkchop 5
/scoreboard players remove @p GameTokens 5
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Kamaji Ogino, Sinitta Leunen, Pixabay, Anna Tarazevich
