What is the command that triggers another command when a specific item is thrown

What is the command that triggers another command when a specific item is thrown - Unrecognizable woman holding paw of dog

The outcome needed is: when a player throws a specific item at a specific block, it triggers a command. Does anyone know how to do it? I have tried and I am unable to figure it out.



Best Answer

If you want to open a door when a flint is thrown on it, you first have to determinate if thrown item has the wanted type.

Detecting that an item is on a door block would be a little tricky, so you could simply use a trigger block.

To do that, you just have to use a scoreboard objective (replace OBJECTIVE by your objective's name) :

/scoreboard players set @e[type=Item] OBJECTIVE 1 {Item:{id:flint}}

This command must be placed into a clock. It will set a score of 1 to the wanted items.

And then execute the following command on all items with a score of 1 to determinate if the item is on a specific block and to execute another command (here, we are assuming that bedrock is your trigger block) :

/execute @e[score_OBJECTIVE=1] ~ ~ ~ testforblock ~ ~-1 ~ bedrock

Put that command on a clock too and get its output by using a comparator. If the comparator is powered, it means that the wanted item was found on the wanted block.

So, put that command at the output of the comparator :

/setblock torch_coords redstone_torch

This command is going to put a torch next to the door (replace torch_coords by torch coordinates — those coordinates can be relative).

And, by using a redstone NOT gate, put another command to close door when the item is picked up :

/setblock torch_coords air 0 replace simply replaces redstone torch by air, thus removing it.




Pictures about "What is the command that triggers another command when a specific item is thrown"

What is the command that triggers another command when a specific item is thrown - Side view of young woman in hoodie sitting on floor near sofa and playing with obedient brown Labrador while resting during free time
What is the command that triggers another command when a specific item is thrown - Crop hacker silhouette typing on computer keyboard while hacking system
What is the command that triggers another command when a specific item is thrown - Full body optimistic young female with curly hair smiling and teaching Beagle dog beg command on sunny summer day in countryside



How do you trigger a command block with an item?

2. Armor stand
  • Use an item which can be put into the hands of an armor stand.
  • Have an (invisible) armor stand constantly teleported to you.
  • whenever you right click your tool it will be put into the hand of that armor stand.
  • test for the armor stand holding that tool and give another item to you + execute your command(s)


  • How do you activate a command with an item?

    The TRIGGER command associates a previously-created program to an object and identifies the object event that automatically executes the program; or a disassociates a trigger program from the object.



    How to trigger commands dropping items in Minecraft Bedrock




    More answers regarding what is the command that triggers another command when a specific item is thrown

    Answer 2

    If you want to make that, you got to do this , first you got to make a objective, by using the command:

    1. /scoreboard objectives add FlintDoor dummy

    Then you got to set the score to 1 for every flint in the world by using this command:

    1. /scoreboard players set @e[type=Item] FlintDoor 1 {Item:{id:flint}}

    Then you detect or a Item with objective score (FlintDoor) 1 is in front of the door, how you do this is by using a command. But you will need to put another command after the execute/detect command , You want to open the door so you can set a redstone torch 2 blocks underneath the door , or You can set a Redstone block 1 block above or 1 block underneath the door, so you want to put this command in the last command block:

    1. /execute @e[score_FlintDoor=1] ~F ~ ~G detect ~ ~-1 ~ your_block 0 /setblock x y z redstone_torch 0 replace

    Or with a redstone block

    1. /execute @e[score_FlintDoor=1] ~F ~ ~G detect ~ ~-1 ~ your_block 0 /setblock x y z redstone_block 0 replace

    You will need to put the second and third or fourth command in a command block clock, if you need more help with them.

    , it will work for 1.8. And you have to replace the x y z in the third and fourth command by the x y z of the blocks, If you need help with that use this
    . You will also have to change the F and G , there are a few combinations:
    1. F=0,G=1
    2. F=0,G=-1
    3. F=1,G=0
    4. F=-1,G=0
    5. F=0,G=0

    I hope this was helpful if you need more help just ask. Cyaa, Gl! :D

    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Ivan Babydov, Ivan Babydov, Anete Lusina, Blue Bird