1

Commandblock command

spotexx's Avatar spotexx6/5/15 12:14 pm
1 emeralds 207 3
6/5/2015 2:17 pm
Jmal116's Avatar Jmal116
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's Avatar
spotexx
Level 1 : New Miner
0

Create an account or sign in to comment.

3

1
06/05/2015 2:17 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
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
06/05/2015 2:11 pm
Level 22 : Expert Network
YTCereal
YTCereal's Avatar
Easy Peacy. just wait when i make the machine.
1
06/05/2015 2:01 pm
Level 1 : New Miner
spotexx
spotexx's Avatar
Help plz?
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome