forum Forumsplay_arrow Minecraft fiber_manual_record Redstone

0

COMMAND BLOCKS

0 emerald • 3 replies138 views
created 02/19/2019 10:01 pm by helpmeilovecommandblocks
last reply 02/22/2019 3:59 am
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 avatar
helpmeilovecommandblocks
Level 1 : New Miner
0

3 replies

2
02/22/2019 2:40 am
Level 4 : Apprentice Modder
HoboMaggot
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
1
02/22/2019 3:59 am
Level 12 : Journeyman Archer
Kwanatla
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
02/19/2019 10:24 pm
Level 1 : New Miner
helpmeilovecommandblocks
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

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome