In Control!

In Control!

82M Downloads

blem with Multiple Spawner Rules in InControl (Minecraft 1.20.1, losticities)

Closed this issue · 5 comments

commented

Hello, I’ve been experimenting with InControl on Minecraft 1.20.1 to create a zombie apocalypse, yes, tipic. My idea is to have different spawn behaviors depending on whether players are in the wilderness, in city streets, or inside buildings.

Here’s the logic I want:

  • Outside cities: some zombies, but not too few, and only at night and in darkness.
  • In city streets: a lot more zombies, even during the day and regardless of light level.
  • Inside city buildings: massive amounts of zombies, much more dangerous than outside.

The Issue

The problem is that only the last section of spawner.json seems to be applied.

For example:

  • If I define multiple entries in spawner.json for different spawn intensities (few / many / massive), the game only uses the last entry.
  • Because of this, zombies spawn massively everywhere, both in and outside of cities.
  • The spawn.json conditions (like incity, instreet, inbuilding, maxlight) seem to work partially, but they don’t combine well with multiple spawner.json rules.

So basically, my outside rules (darkness only, fewer zombies) are ignored, and the city building rule dominates everywhere.


My Current Configs

📄 spawner.json

[
  {
    "mob": "minecraft:zombie",
    "persecond": 0.3,
    "attempts": 4,
    "amount": {
      "minimum": 3,
      "maximum": 6
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "mindist": 16,
      "maxdist": 64,
      "minheight": 0,
      "maxheight": 320,
      "maxthis": 120
    }
  },
  {
    "mob": "minecraft:zombie",
    "persecond": 0.8,
    "attempts": 8,
    "amount": {
      "minimum": 8,
      "maximum": 15
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "mindist": 8,
      "maxdist": 48,
      "minheight": 0,
      "maxheight": 320,
      "maxthis": 200
    }
  },
  {
    "mob": "minecraft:zombie",
    "persecond": 1.2,
    "attempts": 10,
    "amount": {
      "minimum": 15,
      "maximum": 30
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "mindist": 6,
      "maxdist": 32,
      "minheight": 0,
      "maxheight": 320,
      "maxthis": 250
    }
  }
]

📄 spawn.json

[
  {
    "mob": "minecraft:zombie",
    "incity": false,
    "maxlight": 7,
    "when": "onjoin",
    "result": "allow"
  },
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "instreet": true,
    "when": "onjoin",
    "result": "allow"
  },
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "inbuilding": true,
    "when": "onjoin",
    "result": "allow"
  }
]

What Happens

  • Outside cities: zombies spawn only at night (which is correct), but light level is ignored.
  • Inside cities: zombies spawn massively everywhere, no matter if I’m in a street or in a building.
  • It looks like only the last spawner rule is being respected, while the previous ones are ignored.

Question

Is this intended behavior?

  • Should multiple rules in spawner.json combine, or is only the last one applied?
  • Is there a proper way to layer spawn difficulty (few outside, many in streets, tons in buildings)?

Any clarification or fix would be greatly appreciated 🙏. I really want to make the city exploration way more dangerous than the wilderness.


commented

Your defined spawner rules will combine so it's not useful to do that. Best is to create a single spawning rule combining them. There is no point in separating them like you did.

The problem is your spawn.json. It doesn't do anything because you only specify "result": "default" and that's what would happen anyway. When a mob spawns it will go through spawn.json and unless you deny the spawn nothing will change as it was going to spawn anyway. You need to have "deny" rules

commented

But how do I make a single rule that can spawn a certain number of zombies under specific conditions?

commented

something like this?

spawner.json

[
  {
    "mob": "minecraft:zombie",
    "persecond": 1.0,
    "attempts": 15,
    "amount": { "minimum": 2, "maximum": 6 },
    "conditions": {
      "dimension": "minecraft:overworld",
      "norestrictions": true,
      "mindist": 25,
      "maxdist": 100,
      "minheight": 10,
      "maxheight": 200,
      "maxthis": 300
    }
  }
]

spawn.json

[
  {
    "mob": "minecraft:zombie",
    "incity": false,
    "maxlight": 7,
    "result": "deny"
  },
  {
    "mob": "minecraft:zombie",
    "incity": false,
    "random": 0.8,
    "result": "deny"
  },
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "instreet": true,
    "random": 0.3,
    "result": "deny"
  },
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "inbuilding": true,
    "random": 0.1,
    "result": "deny"
  }
]
commented

Try it and see? :-)

commented

Solved! Thanks!!
From what I've tested, this setup works. A quick explanation of what it does for anyone who wants to use it.

  • Zombies spawn outside the city only at night, with a 20% chance.
  • In caves with darkness, with a 40% chance.
  • Buildings and other structures in the city spawn with a 100% chance and with a light level below 10, to allow the player to create bases in the city if desired and if the lighting is good.
  • On city streets during the day, that is, with a maximum light level of 15, zombies will spawn 60% of the time.
  • At night on the city streets, with a light level of no more than 7, zombies will spawn 100% of the time.

spawn.json

[
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "instreet": false,
    "inbuilding": true,
    "minlight": 10,
    "result": "deny"
  },
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "instreet": false,
    "inbuilding": true,
    "minlight": 0,
    "maxlight": 10,
    "result": "allow"
  },
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "instreet": true,
    "inbuilding": false,
    "minlight_full": 0,
    "maxlight_full": 15,
    "random": 0.4,
    "result": "deny"
  },
  {
    "mob": "minecraft:zombie",
    "incity": true,
    "instreet": true,
    "inbuilding": false,
    "minlight": 0,
    "maxlight": 7,
    "result": "allow"
  },
  {
    "mob": "minecraft:zombie",
    "incity": false,
    "instreet": false,
    "inbuilding": false,
    "minlight": 0,
    "maxlight": 7,
    "cave": true,
    "random": 0.6,
    "result": "deny"
  },
  {
    "mob": "minecraft:zombie",
    "incity": false,
    "instreet": false,
    "inbuilding": false,
    "minlight": 0,
    "maxlight": 7,
    "random": 0.8,
    "result": "deny"
  }
]

If you want to change the amount of zombies that spawn globally, to make it harder or easier, modify the spawner file. This is the one I use for my singleplayer world

spawner.json

[
  {
    "persecond": 0.5,
    "attempts": 4,
    "mob": "minecraft:zombie",
    "amount": {
      "minimum": 20,
      "maximum": 30,
      "groupdistance": 6
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "mindist": 15,
      "maxdist": 30,
      "minheight": 0,
      "maxheight": 320,
      "maxhostile": 250
    }
  }
]