1

COMMAND BLOCKS

helpmeilovecommandblocks's Avatar helpmeilovecommandblocks2/19/19 10:01 pm
1 emeralds 284 3
2/22/2019 3:59 am
Kwanatla's Avatar Kwanatla
K so I need help with command blocks. Version 1.13.2
I'm making a minecraft shop (clearly) and don't know how to use /execute for it. /testfor doesn't work, its not a valid command. I'm trying to use /give @p (to give the player the item) and /clear @p (to take the currency that my eco realm uses) and YES, command blocks are on!
Posted by helpmeilovecommandblocks's Avatar
helpmeilovecommandblocks
Level 1 : New Miner
0

Create an account or sign in to comment.

3

Kwanatla
02/22/2019 3:59 am
Level 35 : Artisan Archer
history
Kwanatla's Avatar
Ok, I recently discovered that /testfor doesn't seem to be a fully-fledged command, it's more like a sub command for execute. (I think /execute testfor works). I must recommend the Official Minecraft Wiki for all matters of commands/redstone/basically everything in Minecraft. Lol, I just saw the comment below me, much better!
1
HoboMaggot
02/22/2019 2:40 am
Level 52 : Grandmaster Blob
history
HoboMaggot's Avatar
1.13 has changed the command syntax, and I can say its for the better, but no one likes change.
To clarify, /testfor is now "/execute as" or "/execute if entity"
and /testforblock is now /execute if block

Now to begin

Lets just say you made a currency system called "money"
/scoreboard objectives add money dummy
and a person gets 500 money

/scoreboard players add @s money 500
(The @s means the person executing it, which means you. Send it to @a if you have to)

If you want to detect someone having more than 200 money to buy something, then use the new execute command

/execute as @p[scores={money=200..}] run command
The 2 dots next to 200 is important otherwise you only detect the exact value.

In the run command part you give the person the item using the @s selector (otherwise it gives it to another person)

To take the money away, do /scoreboard players remove @p 200
And the 200 moneys will be gone.

Ask if you have any enquiries
2
helpmeilovecommandblocks
02/19/2019 10:24 pm
Level 1 : New Miner
helpmeilovecommandblocks's Avatar
Also the reason /give and /clear don't work because if a player triggers the command block without sufficient funds, they will still obtain the item
2
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome