MakeCode: Trying to check correct items placed in a chest
I'm trying to get either the player or the agent to detect items placed in a chest and then tell me if these are the correct items placed. I've cloned a chest (with items), destroyed it and got the agent to collect it. If these work, then I will make them into functions. But right now, it doesn't. Can anyone help and are there dedicated Minecraft MakeCode forums that I can ask for help (if this is not the right place?)
-
Hi, Kevin Tan This is interesting.
It seems to me that this is the best place right now. ;)
If you run the copychest command by itself, is it working as expected?0 -
Just as a comment, Kevin Tan did you notice in your nested if statements that you ask if "pickedItem" is both meat and apple? It can never be both. The little exclamation point on the second if statement is complaining to you. I'm not sure if that is the reason or not. More likely, it is because you set pickedItem to zero, which is an integer. Then you tried to compare it to a block. Maybe I am misunderstanding the command.
I would think you would want to be using "get item id from slot (#)" or "get item count from slot (#)"
0 -
Hi Deborah. Yeah, I know pickedItem cannot be both apple and meat but I just don't know how else to tell MakeCode to check for both items.
I did think about using "agent get item id from slot #". Let me think further how exactly to do this. Thanks
0 -
This is what my students and I came up with. I used a list, and my students went for a slightly more hard-coded idea.
https://makecode.com/_Fa9R621tjJTf
The numbers are the item ids of the four items we chose to use. You will have to choose your own items / item ids.
0 -
This is very helpful😁😁😁😁😁😁😁😁😁😁😁😁😁😁
0 -
@sean Lawson
Nothin' better than bein' helpful!
Glad to hear it.0
Please sign in to leave a comment.
Comments
6 comments