I made a custom crafter in Minecraft 1.10.2. I want to obtain it by throwing a dropper and crafting table on the ground together. Everything is OK, but if I throw a dropper and a crafting table really far away from each other (crafting table 50 blocks away from dropper), it still runs. That's not ok. So, how to test if 2 item are nearby one to another in Minecraft?
I suppose you have a
testfor command that tests if both a dropper and a crafting table are on the ground.
What I suggest you do is run an
execute command at either of the two items, and test of the other item is nearby:
/execute @e[<firstItem>] ~ ~ ~ testfor @e[<secondItem>,r=<distance>]
As you can see, I added
r= to test only for entities in a certain radius (if you need the items to be 3 blocks or closer to each other, type
r=3, and so on.). You can then put the command into a command block and lead a comparator out of it that would execute the command for custom crafting.
Because you already had half the thing working, I figured out you already found out a method of testing for specific items. An example can be found here, just in case.