Creating Mob Excluders

Forums SparkQuest Spark Crafters Creating Mob Excluders

  • Creating Mob Excluders

    Posted by profmag on December 24, 2020 at 4:18 am

    I’d like to exclude most mobs (and especially hostile ones) from the New City area on SparkQuest STF. This would make a “civilized” safe zone in and around the city that will prevent too many mob attacks or mob griefing (like creeper craters).

    I’m considering using this method which employs command blocks, but I’m not sure it will work with the large radius I might be using.

    I’m going to test this out using the following command:

    /kill @e[type=!player,type=!sheep,type=!cow,type=!wolf,type=!cat,type=!pig,type=!chicken,type=!villager,type=!horse,r=RADIUS

    All the types specified will hopefully protect mobs and entities of those types while excluding all others.

    I’ll try it out and see how it goes.

    profmag replied 3 years, 10 months ago 1 Member · 5 Replies
  • 5 Replies
  • profmag

    Administrator
    December 24, 2020 at 5:29 am

    Apparently, you can’t use “r=” to specify a radius anymore. You have to use “distance=..#”

    My final command looks like:

    /kill @e[type=!player,type=!sheep,type=!cow,type=!wolf,type=!pig,type=!chicken,type=!villager,type=!horse,type=!cat,type=!egg,distance=..100]

    I’ll have to look into adding entities since this will mean no pet donkeys or parrots for now.

    Now to experiment with the radius…

  • profmag

    Administrator
    January 4, 2021 at 11:35 pm

    What about: bees, donkeys, llamas, mules, iron golems, snow golems, parrots, slalom, cod, puffer fish, squid, tropical fish, clown fish, dolphins, foxes, panda, rabbits, turtles.

    Also, according to the kill command page, non-living targets are also targeted, so it may be necessary to add: boats, minecarts, loose items, paintings, armor stands, and experience orbs.

    • This reply was modified 3 years, 10 months ago by  profmag.
    • This reply was modified 3 years, 10 months ago by  profmag.
  • profmag

    Administrator
    January 5, 2021 at 3:22 am

    Adding in all these additional entities, the command for New City looks like this:

    /kill @e[type=!player,type=!sheep,type=!cow,type=!wolf,type=!pig,type=!chicken,type=!villager,type=!horse,type=!cat,type=!egg,type=!bee,type=!donkey,type=!llama,type=!mule,type=!iron_golem,type=!snow_golem,type=!parrot,type=!salmon,type=!cod,type=!squid,type=!tropical_fish,type=!dolphin,type=!fox,type=!ocelot,type=!panda,type=!rabbit,type=!turtle,type=!boat,type=!painting,type=!minecart,type=!item,type=!armor_stand,type=!experience_orb,distance=..725]
  • profmag

    Administrator
    January 5, 2021 at 5:24 am

    One issue with this method is that killed mobs will leave drops. This means the server will likely attempt to spawn mobs near players, the mobs will be killed, and tons of drops will be left behind.

    Another option I’ve seen around would be to /tp the mobs to the void. I’m not sure this can be done within only a certain radius. Something to research…

  • profmag

    Administrator
    January 19, 2021 at 8:54 pm

    So I set up a series of five command-block excluders in a chamber in the spawn chunk (to keep it from de-loading when players are not present), all using the /tp method. With only a few players, the server attempts to spawn a ton of mobs up to the limit, so that means tons of attempted spawns in area near the spawn chunk. The resulting server load was bogging the whole thing down with the following errors in console:

    19.01 04:40:58 [Server] WARN <player> moved too quickly! 1.0049658983609788,0.0,-23.934473596236728
    19.01 04:10:52 [Server] WARN Can't keep up! Is the server overloaded? Running 145490ms or 2909 ticks behind

    The problem manifested in a glitch that would send the player a split second back in time, making walking a halting mess.

    I’m currently working on using WorldGuard to select a region and then limit mob spawning in that region.

Log in to reply.