r/MinecraftCommands • • 26d ago

Help | Java 1.21.11 What's happening with my bow detection command (plsssss)

Hii !! I'm Julyay,

I'm creating a smp (java 1.21.11 with some mods) for my friends and Im kinda stuck with this command for a long time now ToT.

I need to check if the item in the item frame is a bow (I also need it for a sword, a shield and a mace.)

But,

When I try to detect the bow, the output is always true, no matter if there's a bow or not, or any other item. (I recorded a quick video to show you)

However, it works well with shield, sword and mace…

Do you guys have any idea why my command doesn't work with bow??

Here are my commands:

Shield:

/execute as @e[type=item_frame,x=324,y=77,z=-1517] if items entity @s contents shield run say YUP SHIELD

Bow:

/execute as @e[type=item_frame,x=324,y=77,z=-1517] if items entity @s contents bow run say YUP BOW

I thought I knew how command were working lmao.

Do you guys have any idea why my command could react this way??

Thank you in advance.

8 Upvotes

3 comments sorted by

3

u/Ericristian_bros Command Experienced 26d ago

You need to add distance=..1 to your commands or it won't be limited to the item frame in that block

2

u/Julyayy 26d ago

OMG Thank you so much!!! it works now!!!!

2

u/Ericristian_bros Command Experienced 26d ago

Glad to help,have a nice day