In Control!

In Control!

74M Downloads

maxcount not respected

wheat32 opened this issue ยท 11 comments

commented

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"
  }
]
commented

bump

commented

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

commented

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

commented

Hold on. I misread the rule

commented

What happens if you remove the maxlight line?

commented

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

commented

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

commented

Just an update: the issue is still present in 3.9.13

commented

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

commented

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

commented

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.