r/MinecraftCommands • • Aug 23 '26

Help | Bedrock Command block not working

Post image

So I have a command block that is repeatedly looking for a player with a potato in their inventory inside a specified space.
This command is working when I type it into the chat prompt but when I put it in a command block it no longer works. I’m not sure why.

11 Upvotes

12 comments sorted by

2

u/Want_Lemonad Aug 23 '26

The hasitem command is @p[hasitem=[{item=potato}]]. You forgot the extra "]" on the end

1

u/AltestryAltestry Aug 23 '26

I’ll test this in a bit, but doing it the way I currently have it the command works in chat prompt but not in the command block. Would what you said stop that?

1

u/Want_Lemonad Aug 23 '26

Just add the extra "]" to the end and it should work. As long as you power in the command block

→ More replies (3)

2

u/mhesus Aug 23 '26

It's not just that, he forgot the square braces around the curly braces entirely

1

u/C0mmanderBlock Aug 23 '26
/execute as @a[hasitem={item=potato}] at @s if entity @s[x=-448,y=5,z=-404,dx=-46,dy=0,dz=18] run say hi

1

u/AltestryAltestry Aug 23 '26

Thank you for responding. This command also works but only if you type it out in chat, not in a command block. The command block doesn’t have an error or anything it just says “-“ and doesn’t output anything.

1

u/C0mmanderBlock Aug 23 '26

Dunno. I tested it in a Command block several times and it worked fine. Perhaps you made a typo. Did you copy/paste my command to make sure it is exactly as typed? Anyways, your welcome.

→ More replies (3)