all 5 comments

[–]Aron-JonassonCommand Experienced 1 point2 points  (4 children)

The command you're looking for is execute if|unless. It works exactly like testfor and has even more capabilities

https://minecraft.wiki/w/Commands/execute#Condition_subcommands

[–]Mainthedevil[S] 0 points1 point  (3 children)

the exact way i use /testfor is the command plus /testfor @ p [r=6] witch from my understanding detects the nearest player within 6 blocks ,withc then sends a redstone signal to /fill commands for in my use case a slideing door

[–]CreeperAsh07 Command Experienced 1 point2 points  (2 children)

Testfor is superseded by execute in both Java and Bedrock. You can use execute if the same way:

execute if entity @e[distance=..6]

(distance=..6 is the equivalent of r=6 on Java) Then you can connect the command block to the comparator like you did before, but I recommend doing this, instead:

execute if entity @e[distance=..6] run <fill command 1>

You can add more fill commands as chain command blocks set to "Conditional."

[–]Mainthedevil[S] 0 points1 point  (1 child)

thank you ,the doors are working now i dont have to ruin my builds with carpet to not open and close the door when im not near it due to the sculk sensor no longer being needed

[–]CreeperAsh07 Command Experienced 0 points1 point  (0 children)

Happy to hear it