1

Function Command Help.

ExtremeGaming654's Avatar ExtremeGaming6546/8/17 10:45 pm
1 emeralds 595 6
6/9/2017 4:47 pm
Heklo's Avatar Heklo
Is it possible to make a function command conditional so it will not move on to the next command if the previous command was not executable?
I am trying to make this function work but every time you execute it the commands it will give you money even if you do not have any iron.


testfor @s[r=5] {Inventory:[{id:"minecraft:iron ingot",Count:1b}]}

clear @s[r=5] iron_ingot 0 1

scoreboard players add @s Money 10

tellraw @s ["",{"text":"$10","bold":true,"color":"dark_green"},{"text":" ","bold":true,"color":"dark_red"},{"text":"Has Been Added To Your Account.","color":"green"}]

Any Ideas? Thanks for that help.
Posted by ExtremeGaming654's Avatar
ExtremeGaming654
Level 1 : New Explorer
0

Create an account or sign in to comment.

6

info Note: You're viewing a single reply. View all replies
1
06/09/2017 4:47 pm
Level 23 : Expert Engineer
Heklo
Heklo's Avatar
A function can also be linked up to a chain of command blocks that are conditional. Setting a redstone block at the beginning of a command line could do that, but it would have to be in a constantly loaded area such as spawn chunks.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome