1
Command block help
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.
/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.
Create an account or sign in to comment.
4
1
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.
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
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. 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
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
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.