McJtyMods / InControl

Be In Control of Mob Spawns and others
MIT License
46 stars 17 forks source link

maxcount not respected #138

Open wheat32 opened 5 years ago

wheat32 commented 5 years ago

I have the following spawn.json:


[
  {
    "dimension": 0,
    "seesky": true,
        "maxlight": 4,
    "hostile": true,
    "random": 0.005,
    "maxcount": 
    {
          "amount": 5,
      "mod": "minecraft",
      "hostile": true,
          "perplayer": true
        },
    "result": "default"
  },
  {
        "result": "deny"
  }
]

I am using a superflat world to test. Monsters still spawn past the maxcount amount.

Oddly enough, I tested this spawn.json file which worked in The End dimension:

[
  {
    "dimension": 1,
    "mob": "minecraft:enderman",
    "hostile": true,
    "random": 0.005,
    "maxcount": 
    {
          "amount": 5,
      "mod": "minecraft",
      "hostile": true,
          "perplayer": true
        },
    "result": "default"
  },
  {
    "result": "deny"
  }
]
McJty commented 5 years ago

Remove the random line. That line causes the rule to only work some times

McJty commented 5 years ago

Hold on. I misread the rule

McJty commented 5 years ago

What happens if you remove the maxlight line?

wheat32 commented 5 years ago

It is the same result. Mobs still spawn up to the vanilla maximum amount amount instead of the maxcount amount of 5.

McJty commented 5 years ago

I am now on vacation but I'll check it out when I'm back

wheat32 commented 5 years ago

Just an update: the issue is still present in 3.9.13

tyon2006 commented 4 years ago

bump

McJty commented 4 years ago

Not sure why that isn't working. I can't see what's wrong. Is that the only rule in the file? is that your entire spawn.json? Can you try to enable debugging (/ctrldebug) and see what rules fire? Post your entire jsons here so I can see what exactly is in it

darthvader45 commented 3 years ago

Weird, having similar issues in 3.9.18. No idea what could be the problem. I wanted mobs from the FNAF Universe mod to spawn in small groups scattered across the world at night and in dark places. Yet they still spawn in massive droves. Not only that, but the spawns only work if the rules are in potentialspawn.json and not spawn.json.

Here's my potentialspawn.json: https://pastebin.com/uqJREeb1

McJty commented 3 years ago

@darthvader45 remove 'maxcount' from potentialspawn and test for that in spawn.json. i.e. you need to combine potentialspawn and spawn

darthvader45 commented 3 years ago

Thanks, will try that.

Edit: Didn't work apparently. Managed a workaround of sorts using conditions to limit spawning based on the number of vanilla hostile mobs. Not entirely the solution I had in mind, but if it works, oh well.