1

Commandblock command

spotexx 6/5/15 12:14 pm
255
6/5/2015 2:17 pm
how can i search the closest player to see if they have coal block in their inventory, if true then remove 1 block and set a block above the command block. Thanks in advance.
Posted by
spotexx
Level 1 : New Miner
0

  Have something to say?

JoinSign in

3

Jmal116
06/05/2015 2:17 pm
Level 34 : Artisan System
I'm going to do this with a scoreboard objective, you can call it whatever you want, but I'm going to call mine 'potatoes'. Once you have your scoreboard set up, just run these commands whenever you want to check (keep them in this order):
scoreboard players set @p potatoes 1 {Inventory:[{id:"minecraft:coal_block"}]}clear @p[score_potatoes_min=1] coal_block -1 1execute @p[score_potatoes_min=1] ~ ~ ~ setblock coal_block x y zscoreboard players set @a potatoes 0
I'm assuming you want remove one block of coal from the players inventory, and then place a block of coal over the command block if one is found in the player's inventory. If not, you can change the /clear and /setblock commands to whatever you'd like.
1
YTCereal
06/05/2015 2:11 pm
Level 22 : Expert Network
Easy Peacy. just wait when i make the machine.
1
spotexx
06/05/2015 2:01 pm
Level 1 : New Miner
Help plz?
1

Welcome