1

Command block help

TeenMC's Avatar TeenMC7/28/16 3:00 pm
1 emeralds 323 4
7/29/2016 4:07 pm
DepthStrider's Avatar DepthStrider
SO my friend and I are trying to detect when someone takes a diamond out of a chest. we don't want to use a comparator. we have this command set up:

/testforblock 14952 63 14846 minecraft:chest 5 {Items:[0:
{Slot:0b,id:"minecraft:air",Count:1b,Damage:0s}]}

it howerver doesn't seem to be working correctly.
we are in 1.10 if it helps.
Posted by TeenMC's Avatar
TeenMC
Level 3 : Apprentice Miner
0

Create an account or sign in to comment.

4

1
07/28/2016 8:40 pm
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Just put the command in a command block, on a clock.
Then place a comparator (you got to use them one way or the other )
facing away from that command block.

Assuming you are testing for a diamond in the chest, place a block behind the comparator with a redstone torch to the side. (Inverting the signal)

Then place a repeater facing away from the torch... this is your output and you could put another command block behind the repeater.
1
07/29/2016 4:07 pm
Level 19 : Journeyman Artist
DepthStrider
DepthStrider's Avatar
In this case. No comparators aren't needed.

1. repeating command block:
/testforblock 14952 63 14846 minecraft:chest 5 {Items:[
{Slot:0b,id:"minecraft:diamond"}]}

2. chain command block:
/testforblock (co-ordinates of the previous command block) repeating_command_block -1 {SuccessCount:0b}

3. conditional command block:
Run whatever you want.

Do note that you might want to reset the thing afterwards or the command/s will loop until a diamond is added again.
1
07/28/2016 6:47 pm
Level 19 : Journeyman Artist
DepthStrider
DepthStrider's Avatar
As far as I know you cannot detect for air in a slot. However you could detect if there's a diamond there, when the output is false it means the diamond isn't there. Thus we can ASSUME that there's air in that slot and not another kind of item.
1
07/28/2016 7:10 pm
Level 3 : Apprentice Miner
TeenMC
TeenMC's Avatar
but how do we make it so that when the diamond is not detected anymore, it says to do /tp <coords> and nothing when it is detecting it.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome