How to check for items in an item frame?
I was told to post this on the community forms, there seem not to be a sulotion outlined in my other forum post https://educommunity.minecraft.net/hc/en-us/requests/193727
I want to use a command to be able to open an iron door when the bread item is placed in the item frame, but ignore othe items.
What command do I use to test the bread item in the item frame? I tried using the testfor command, but I am not sure how to implement it for the specific item in the item frame.
If anyone has an solution to this, I will be very grateful.
The "execute as" command to find the <uuid> does not bring up any suggestions when looking at the item frame in game for the /execute command
-
Thank you for your assistance. I will use a different command to build the activity. It would be a good feature to have in the Minecraft Education Edition to test for items in an item frame.
1 -
Our world designer recommended using the /testforblocks command to check the player's item frame matches with an item frame you've hidden in the world that contains the "correct answer" (item frame with bread). Typically, the hidden comparison block would be put in your control room near where your command blocks are.
1 -
So you want the door to be open at all times after the bread item had been placed in a certain frame?
ISTM you need to lay this out a little more. If there is a certain frame that is going to hold certain items, and at some times, players will place bread there, and then place that frame in a certain location, then an iron door will be open? Is that what you are looking for?
0 -
Hi
Yes. When the player places like example a bread item in the item frame, then it activates the redstone and opens the door.
I want to use command blocks to prevent players from using other items like example books.
I will post some screenshots
0 -
Example like this
0 -
I noticed if I use the following command in the text field
"/testfor @e[type=item,name=bread]" it works
but if I use the same command in the command block, it gives me there "no target selected error"
any idea why?
0 -
try adding a range parameter inside the brackets like r=3
0 -
Does the bread become a block when placed in the item frame, like does the id change?
The r=3 is working, but it is not picking up the bread in the item frame and keeps giving me the "No targets matched selector" error
command is: /testfor @e[type=minecraft:item, name=item.bread.name, r=5, x=7, y=-59, z=31]
0 -
I'm thinking that you have to test for a frame with the attribute that it contains bread, but I don't know commands for that. Dan Noble or Micah M is there a chat level command that tests frames and distinguishes between one item and the next being put in it?
On the other hand, Juanay Hauptfleisch there is an old saying among programmers;
"If at first you don't succeed, redefine success." Perhaps redefining success in this case could just mean placing something in a spot instead. =]
0 -
Thank you so much for your help!
I used /testfor command with hasitem for now. I will test the /testforblocks command in a seperate map.
0
Please sign in to leave a comment.
Comments
10 comments