Anyone know what the command is for /testfor an item in a players off-hand inventory slot? I'm trying to make a garage door remote using /testfor @p[name=me] on the firstfcommand block, then /testfor @p for preferred item (totem that looks like a cell phone in my texture pack) in the off-hand inventory slot on the second CB so that it will open/close my garage door. But I need to know how to I type the command for the second one. I've googled and Youtubed it for hours but keep getting everything but what I'm looking for.
I could just do it with pressure plates but that's boring.
What about a custom item to open the door? You could use testforblocks. Put your totem or garage opener in a chest or on an item frame and have that open the door. Not as flashy as the inventory but I think that would look really sick to do a testforblocks with an item frame and just put that item in the item frame and then do a cool method to return the item to the player. (You could do something as simple as just destroying the item frame and placing a new one)
Sounds cool, but I was going for something that would not require me to get in and out of the car (mods) to open/close the garage door. But I ended up just going with /testfor on CBs on either side of my garage door that test for me and toggle the door if it detects me (and only me) in front of the door, that way I can just drive up to it and it'll do everything on it's own. Works great.
Not as cool as my original idea, but still pretty good. I also attached a lever to lockout a repeater should I want to lock the garage door open/close regardless of my presence above the /testfor CBs.
Well... you could get some armorstands and name them garage door.
When you set them down have it detect it, open your door, and then delete the armor stand. Or you could make that armorstand function as a door lock. I just feel like it would be cool to have a garage door opener so it doesnt just have to detect. The armor stand could be what allows you to power the testfor CB
Anyone know what the command is for /testfor an item in a players off-hand inventory slot? I'm trying to make a garage door remote using /testfor @p[name=me] on the firstfcommand block, then /testfor @p for preferred item (totem that looks like a cell phone in my texture pack) in the off-hand inventory slot on the second CB so that it will open/close my garage door. But I need to know how to I type the command for the second one. I've googled and Youtubed it for hours but keep getting everything but what I'm looking for.
I could just do it with pressure plates but that's boring.
What about a custom item to open the door? You could use testforblocks. Put your totem or garage opener in a chest or on an item frame and have that open the door. Not as flashy as the inventory but I think that would look really sick to do a testforblocks with an item frame and just put that item in the item frame and then do a cool method to return the item to the player. (You could do something as simple as just destroying the item frame and placing a new one)
Sounds cool, but I was going for something that would not require me to get in and out of the car (mods) to open/close the garage door. But I ended up just going with /testfor on CBs on either side of my garage door that test for me and toggle the door if it detects me (and only me) in front of the door, that way I can just drive up to it and it'll do everything on it's own. Works great.
Not as cool as my original idea, but still pretty good. I also attached a lever to lockout a repeater should I want to lock the garage door open/close regardless of my presence above the /testfor CBs.
Well... you could get some armorstands and name them garage door.
When you set them down have it detect it, open your door, and then delete the armor stand. Or you could make that armorstand function as a door lock. I just feel like it would be cool to have a garage door opener so it doesnt just have to detect. The armor stand could be what allows you to power the testfor CB