2

SOLVED: Execute if not working as expected after 1.20 update?

Tim355's Avatar Tim3554/2/24 5:10 pm history
2 emeralds 135 2
4/7/2024 3:16 pm
Tim355's Avatar Tim355
Hello, I have some markers at buttons which I use to detect inputs without command blocks.





/execute as @e[tag=elv_button,scores={Cooldown=..0}] at @s run say "a"
True

/execute as @e[tag=elv_button] at @s if block ~ ~ ~ #minecraft:stone_buttons[powered=true] run say "a"
True

/execute as @e[tag=elv_button,scores={Cooldown=..0}] at @s if block ~ ~ ~ #minecraft:stone_buttons[powered=true] run say "a"
False???

Cooldown is needed so that the button doesn't get triggered several times. I check and can confirm that it is zero. The first line checks if the score is 0 or less and prints "a", the second line checks if the block at the marker is a pressed button, it also prints "a". But combining the two doesn't work??? I have no idea why or how and it's confusing the hell out of me. That exact command worked in 1.19.4, but after updating to 1.20.4 it no longer does.

My server is running paper 1.20.4.

If you guys have any ideas what's going on, please let me know.
Posted by Tim355's Avatar
Tim355
Level 1 : New System
2

Create an account or sign in to comment.

2

1
04/07/2024 3:16 pm
Level 1 : New System
Tim355
Tim355's Avatar
I found a fix, my tick function was being stupid.
1
04/04/2024 8:58 pm
Level 37 : Artisan Modder
Lickydog
Lickydog's Avatar
The command should work.
I combined the parts and it is exactly the same command.

I also ran a similar command in 1.20.4 and it worked fine.


Check if the block is still a button and the score is still 0 or less.
Try this:
execute as @e[tag=elv_button] if score @s Cooldown matches ..0 run say Test passed.


If you didn't find the problem, maybe it's the server software. I don't know much about paper, so I can't help with this.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome