1

Can you be too far away for a command block to work? (ie. command does not execute)

I am curious because I was making a super-flat world a void one by filling a 7x7x4 zone around the player with air to clear it. But as I got farther away from the repeating command block, the space around me was not being filled. However when I got close enough to the command block, the command executed successfully. There is no radius limiter in the command itself, so I was wondering wether or not there is a hard-coded range limiter for command blocks.

1
  • 1
    I recall that command blocks used to only work if the chunk they were in was loaded. I'm not sure about the current mechanics, but perhaps it works the same way now.
    – Hacker
    Commented Sep 27, 2021 at 3:54

1 Answer 1

2

Commandblocks only run while they are loaded. Because bedrock doesn't have spawnchunks like Java that are always loaded, once you're too far away (determined by your simulation distance) the chunks the commandblock is in are unloaded and it stops working.

To make sure the chunk that the commandblock is in stays permanently loaded, you can use the tickingarea command.

For example, assuming your commandblock is located at 10 20 30:

tickingarea add 10 20 30 10 20 30

and once you're done you should remove it again

tickinarea remove 10 20 30
3
  • Thank you! One question: why should I remove my ticking area afterwards? Does this have any benefit? Commented Sep 30, 2021 at 20:33
  • 1
    The tickingarea ensures that this area is always loaded, which takes up server processing resources. So once you don't need it anymore you should remove it to free those resources again. Keeping it around would make the server more laggy (depending on the amount of things going on in that ticking area it could be marginal or substantial, but either way it will improve performance).
    – Plagiatus
    Commented Oct 1, 2021 at 9:44
  • Thank you! I definitely observed a huge performance drop after entering the nether with the ticking area. Commented Oct 1, 2021 at 12:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .