How can I keep mobs from being too close together with /spreadplayers and /execute?











up vote
2
down vote

favorite












I want to summon multiple Slimes, then make sure that they are never in the same block. (If it's not possible to keep them from being in the same block, having them be at least 1 block from each other would work too.)



To do this I tried nesting execute commands like this:



execute @e[type=Slime,name=explore1] ~ ~ ~ execute @e[type=Slime,name=explore1,r=0,c=1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,r=1,c=1]


But that didn't work. I also tried



execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,c=1,r=0]


I figured the r=0 tag might be off but I also tried with r=1 and it still didn't work.



The first command groups all the Slimes together and randomly teleports them, and the second command just does nothing.



Any ideas on how to do this?










share|improve this question
















bumped to the homepage by Community 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.



















    up vote
    2
    down vote

    favorite












    I want to summon multiple Slimes, then make sure that they are never in the same block. (If it's not possible to keep them from being in the same block, having them be at least 1 block from each other would work too.)



    To do this I tried nesting execute commands like this:



    execute @e[type=Slime,name=explore1] ~ ~ ~ execute @e[type=Slime,name=explore1,r=0,c=1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,r=1,c=1]


    But that didn't work. I also tried



    execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,c=1,r=0]


    I figured the r=0 tag might be off but I also tried with r=1 and it still didn't work.



    The first command groups all the Slimes together and randomly teleports them, and the second command just does nothing.



    Any ideas on how to do this?










    share|improve this question
















    bumped to the homepage by Community 4 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I want to summon multiple Slimes, then make sure that they are never in the same block. (If it's not possible to keep them from being in the same block, having them be at least 1 block from each other would work too.)



      To do this I tried nesting execute commands like this:



      execute @e[type=Slime,name=explore1] ~ ~ ~ execute @e[type=Slime,name=explore1,r=0,c=1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,r=1,c=1]


      But that didn't work. I also tried



      execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,c=1,r=0]


      I figured the r=0 tag might be off but I also tried with r=1 and it still didn't work.



      The first command groups all the Slimes together and randomly teleports them, and the second command just does nothing.



      Any ideas on how to do this?










      share|improve this question















      I want to summon multiple Slimes, then make sure that they are never in the same block. (If it's not possible to keep them from being in the same block, having them be at least 1 block from each other would work too.)



      To do this I tried nesting execute commands like this:



      execute @e[type=Slime,name=explore1] ~ ~ ~ execute @e[type=Slime,name=explore1,r=0,c=1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,r=1,c=1]


      But that didn't work. I also tried



      execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~.5 ~.5 0 1 false @e[type=Slime,name=explore1,c=1,r=0]


      I figured the r=0 tag might be off but I also tried with r=1 and it still didn't work.



      The first command groups all the Slimes together and randomly teleports them, and the second command just does nothing.



      Any ideas on how to do this?







      minecraft minecraft-commands






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 '16 at 15:05

























      asked Mar 6 '16 at 23:30









      A.J. Ruckman

      1037




      1037





      bumped to the homepage by Community 4 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 4 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The following command should work:



          execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~ ~ 2 3 false @e[type=Slime,rm=0,r=1,name=explore1]


          All slimes will try to spread nearby (r=1) slimes that aren't themselves (rm=0) a maximum of 3 blocks around them.






          share|improve this answer





















          • Just be aware that rm=0 will not be able to target entities at the exact same coordinates as the slime, so if two are at the same location then they will not be targeted. /spreadplayers itself can end up placing slimes at the same location.
            – Skylinerw
            Mar 7 '16 at 18:11










          • @Skylinerw Yep, when I was testing it though it didn't seem an issue in practice, as the slimes immediately push each other apart slightly then get teleported (though it could be a problem if OP has them with NoAI).
            – SirBenet
            Mar 7 '16 at 18:31












          • I'm afraid this isn't working for me @colorfusion, the slimes never stop being spread around... I was using NoAI but it still doesn't work with it off.
            – A.J. Ruckman
            Mar 7 '16 at 20:01










          • Update: It works with NoAI off and rm=1 + r=2 in the last command, but that's not completely ideal; I really need the slimes to have NoAI. Any ideas?
            – A.J. Ruckman
            Mar 7 '16 at 20:04










          • @A.J.Ruckman Do you need to constantly check if slimes are on top of each other, or just when you summon/manually move them? There's another possible solution either way, but which one works best depends on what you're actually using the slimes for (why do they need to be never close together?).
            – SirBenet
            Mar 7 '16 at 21:09











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "41"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f257914%2fhow-can-i-keep-mobs-from-being-too-close-together-with-spreadplayers-and-execu%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          The following command should work:



          execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~ ~ 2 3 false @e[type=Slime,rm=0,r=1,name=explore1]


          All slimes will try to spread nearby (r=1) slimes that aren't themselves (rm=0) a maximum of 3 blocks around them.






          share|improve this answer





















          • Just be aware that rm=0 will not be able to target entities at the exact same coordinates as the slime, so if two are at the same location then they will not be targeted. /spreadplayers itself can end up placing slimes at the same location.
            – Skylinerw
            Mar 7 '16 at 18:11










          • @Skylinerw Yep, when I was testing it though it didn't seem an issue in practice, as the slimes immediately push each other apart slightly then get teleported (though it could be a problem if OP has them with NoAI).
            – SirBenet
            Mar 7 '16 at 18:31












          • I'm afraid this isn't working for me @colorfusion, the slimes never stop being spread around... I was using NoAI but it still doesn't work with it off.
            – A.J. Ruckman
            Mar 7 '16 at 20:01










          • Update: It works with NoAI off and rm=1 + r=2 in the last command, but that's not completely ideal; I really need the slimes to have NoAI. Any ideas?
            – A.J. Ruckman
            Mar 7 '16 at 20:04










          • @A.J.Ruckman Do you need to constantly check if slimes are on top of each other, or just when you summon/manually move them? There's another possible solution either way, but which one works best depends on what you're actually using the slimes for (why do they need to be never close together?).
            – SirBenet
            Mar 7 '16 at 21:09















          up vote
          0
          down vote













          The following command should work:



          execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~ ~ 2 3 false @e[type=Slime,rm=0,r=1,name=explore1]


          All slimes will try to spread nearby (r=1) slimes that aren't themselves (rm=0) a maximum of 3 blocks around them.






          share|improve this answer





















          • Just be aware that rm=0 will not be able to target entities at the exact same coordinates as the slime, so if two are at the same location then they will not be targeted. /spreadplayers itself can end up placing slimes at the same location.
            – Skylinerw
            Mar 7 '16 at 18:11










          • @Skylinerw Yep, when I was testing it though it didn't seem an issue in practice, as the slimes immediately push each other apart slightly then get teleported (though it could be a problem if OP has them with NoAI).
            – SirBenet
            Mar 7 '16 at 18:31












          • I'm afraid this isn't working for me @colorfusion, the slimes never stop being spread around... I was using NoAI but it still doesn't work with it off.
            – A.J. Ruckman
            Mar 7 '16 at 20:01










          • Update: It works with NoAI off and rm=1 + r=2 in the last command, but that's not completely ideal; I really need the slimes to have NoAI. Any ideas?
            – A.J. Ruckman
            Mar 7 '16 at 20:04










          • @A.J.Ruckman Do you need to constantly check if slimes are on top of each other, or just when you summon/manually move them? There's another possible solution either way, but which one works best depends on what you're actually using the slimes for (why do they need to be never close together?).
            – SirBenet
            Mar 7 '16 at 21:09













          up vote
          0
          down vote










          up vote
          0
          down vote









          The following command should work:



          execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~ ~ 2 3 false @e[type=Slime,rm=0,r=1,name=explore1]


          All slimes will try to spread nearby (r=1) slimes that aren't themselves (rm=0) a maximum of 3 blocks around them.






          share|improve this answer












          The following command should work:



          execute @e[type=Slime,name=explore1] ~ ~ ~ spreadplayers ~ ~ 2 3 false @e[type=Slime,rm=0,r=1,name=explore1]


          All slimes will try to spread nearby (r=1) slimes that aren't themselves (rm=0) a maximum of 3 blocks around them.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 7 '16 at 17:36









          SirBenet

          25k34575




          25k34575












          • Just be aware that rm=0 will not be able to target entities at the exact same coordinates as the slime, so if two are at the same location then they will not be targeted. /spreadplayers itself can end up placing slimes at the same location.
            – Skylinerw
            Mar 7 '16 at 18:11










          • @Skylinerw Yep, when I was testing it though it didn't seem an issue in practice, as the slimes immediately push each other apart slightly then get teleported (though it could be a problem if OP has them with NoAI).
            – SirBenet
            Mar 7 '16 at 18:31












          • I'm afraid this isn't working for me @colorfusion, the slimes never stop being spread around... I was using NoAI but it still doesn't work with it off.
            – A.J. Ruckman
            Mar 7 '16 at 20:01










          • Update: It works with NoAI off and rm=1 + r=2 in the last command, but that's not completely ideal; I really need the slimes to have NoAI. Any ideas?
            – A.J. Ruckman
            Mar 7 '16 at 20:04










          • @A.J.Ruckman Do you need to constantly check if slimes are on top of each other, or just when you summon/manually move them? There's another possible solution either way, but which one works best depends on what you're actually using the slimes for (why do they need to be never close together?).
            – SirBenet
            Mar 7 '16 at 21:09


















          • Just be aware that rm=0 will not be able to target entities at the exact same coordinates as the slime, so if two are at the same location then they will not be targeted. /spreadplayers itself can end up placing slimes at the same location.
            – Skylinerw
            Mar 7 '16 at 18:11










          • @Skylinerw Yep, when I was testing it though it didn't seem an issue in practice, as the slimes immediately push each other apart slightly then get teleported (though it could be a problem if OP has them with NoAI).
            – SirBenet
            Mar 7 '16 at 18:31












          • I'm afraid this isn't working for me @colorfusion, the slimes never stop being spread around... I was using NoAI but it still doesn't work with it off.
            – A.J. Ruckman
            Mar 7 '16 at 20:01










          • Update: It works with NoAI off and rm=1 + r=2 in the last command, but that's not completely ideal; I really need the slimes to have NoAI. Any ideas?
            – A.J. Ruckman
            Mar 7 '16 at 20:04










          • @A.J.Ruckman Do you need to constantly check if slimes are on top of each other, or just when you summon/manually move them? There's another possible solution either way, but which one works best depends on what you're actually using the slimes for (why do they need to be never close together?).
            – SirBenet
            Mar 7 '16 at 21:09
















          Just be aware that rm=0 will not be able to target entities at the exact same coordinates as the slime, so if two are at the same location then they will not be targeted. /spreadplayers itself can end up placing slimes at the same location.
          – Skylinerw
          Mar 7 '16 at 18:11




          Just be aware that rm=0 will not be able to target entities at the exact same coordinates as the slime, so if two are at the same location then they will not be targeted. /spreadplayers itself can end up placing slimes at the same location.
          – Skylinerw
          Mar 7 '16 at 18:11












          @Skylinerw Yep, when I was testing it though it didn't seem an issue in practice, as the slimes immediately push each other apart slightly then get teleported (though it could be a problem if OP has them with NoAI).
          – SirBenet
          Mar 7 '16 at 18:31






          @Skylinerw Yep, when I was testing it though it didn't seem an issue in practice, as the slimes immediately push each other apart slightly then get teleported (though it could be a problem if OP has them with NoAI).
          – SirBenet
          Mar 7 '16 at 18:31














          I'm afraid this isn't working for me @colorfusion, the slimes never stop being spread around... I was using NoAI but it still doesn't work with it off.
          – A.J. Ruckman
          Mar 7 '16 at 20:01




          I'm afraid this isn't working for me @colorfusion, the slimes never stop being spread around... I was using NoAI but it still doesn't work with it off.
          – A.J. Ruckman
          Mar 7 '16 at 20:01












          Update: It works with NoAI off and rm=1 + r=2 in the last command, but that's not completely ideal; I really need the slimes to have NoAI. Any ideas?
          – A.J. Ruckman
          Mar 7 '16 at 20:04




          Update: It works with NoAI off and rm=1 + r=2 in the last command, but that's not completely ideal; I really need the slimes to have NoAI. Any ideas?
          – A.J. Ruckman
          Mar 7 '16 at 20:04












          @A.J.Ruckman Do you need to constantly check if slimes are on top of each other, or just when you summon/manually move them? There's another possible solution either way, but which one works best depends on what you're actually using the slimes for (why do they need to be never close together?).
          – SirBenet
          Mar 7 '16 at 21:09




          @A.J.Ruckman Do you need to constantly check if slimes are on top of each other, or just when you summon/manually move them? There's another possible solution either way, but which one works best depends on what you're actually using the slimes for (why do they need to be never close together?).
          – SirBenet
          Mar 7 '16 at 21:09


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Arqade!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgaming.stackexchange.com%2fquestions%2f257914%2fhow-can-i-keep-mobs-from-being-too-close-together-with-spreadplayers-and-execu%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Михайлов, Христо

          Гороховецкий артиллерийский полигон

          Центральная группа войск