-1

(continuation of two other questions: Original Question , Question Two) I fixed the cmdTrigger signs and they were working almost perfectly, but when I use put them down in areas far away from the command blocks that set up the different triggers, they do nothing. Basically, the signs near the cmdTrigger command blocks work, but the ones far away from it don't. I've tried making a second identical command block chain near the areas I need the signs in but they don't work still. Is there a way to fix this?

1

The command blocks are being unloaded as no players are loading the chunks they are located in. The command blocks have to be loaded when the sign is clicked.

Either the command blocks need to be near the signs that run the commands or a better alternative would be to locate them in the spawn chunks.

In the spawn chunks, they will never be unloaded which allows the signs to be placed anywhere in the world and still function properly.


Another possible solution would be to use a function. This could be run using the gamerule gameLoopFunction and avoid command blocks all together. This involves creating a function file with all the desired commands and using the gamerule to cause this function to run every tick. This would also be a little easier to setup if you are setting up lots of different command sign trigger scores as you could copy and paste the commands and change the values.

An example function could be:

tp @a[score_cmdTrigger_min=1,score_cmdTrigger=1] <x1> <y1> <z1>
scoreboard players set @a[score_cmdTrigger_min=1,score_cmdTrigger=1] cmdTrigger 0

tp @a[score_cmdTrigger_min=2,score_cmdTrigger=2] <x2> <y2> <z2>
scoreboard players set @a[score_cmdTrigger_min=2,score_cmdTrigger=2] cmdTrigger 0

tp @a[score_cmdTrigger_min=3,score_cmdTrigger=3] <x3> <y3> <z3>
scoreboard players set @a[score_cmdTrigger_min=1,score_cmdTrigger=1] cmdTrigger 0

This could continue for as many as needed.

  • Sigh. So complicated – hakalo Jan 28 '18 at 2:09
  • 1
    The first part of the answer is fairly simple. Destroy your bed if you have one and die. Where ever you spawn, dig down to bedrock, build a little bedrock room, and put the command blocks in there. Just mark the coordinates to your bed if you do destroy one so you can tp back. You could also use /setworldspawn at the current command blocks, however, this new location is where players will spawn when they die or enter the map for the first time. – IronAnvil Jan 28 '18 at 5:52
  • Um.... what? What does this have to do with my question? – hakalo Jan 28 '18 at 16:51
  • 1
    The chunks your command blocks are in, are being unloaded. This means the command blocks do not function at all. If you put those same command blocks in the spawn chunks or set the world spawn point to the current command blocks, they will never unload. I recommend moving the command blocks instead of the spawn point. Your question is why only some signs work, the answer is the command blocks are unloading. Moving them to the spawn chunks would fix the problem. – IronAnvil Jan 28 '18 at 17:56
  • Ok, but the server is very spread out. Sections can be up to 1000 blocks away from each other – hakalo Jan 28 '18 at 20:51
1

The command blocks need to be in the spawn chunks so that they work at all times no matter where you go. To find you spawn chunks you can respawn using the command /kill Alternatively, if you can't find the world spawn you can change it using the command /setworldspawn ~ ~ ~.

Then you can place command blocks within a 30 block radius of the world spawn that you have just set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.