McJtyMods / InControl

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

"mod" tag appears to not work with passive mobs #178

Open MechanosG opened 4 years ago

MechanosG commented 4 years ago

Pretty much what the name says, and easily reproducible. The following was tested in spawn.json.

    {
        "dimension": 0,
        "passive": true,
        "mincount": 3,
        "result": "deny"
    }

The above works correctly. Passive mobs (cows, sheep, etc) will stop spawning once there's 3 of a type. However..

    {
        "dimension": 0,
        "mod": "minecraft",
        "passive": true,
        "mincount": 3,
        "result": "deny"
    }

Add the "mod" tag, and it stops working, as if vanilla mobs aren't seen as being from "minecraft".

MC 1.12.2 forge-14.23.5.2847 incontrol-1.12-3.9.16.jar

Twosiders commented 4 years ago

hey man, sorry to hijack this bug report, but I you seem knowledgeable enough regarding this mod. Spent the last hour and a half tussling with the syntax and the mod; how does one prevent animal spawns after like let's say 2 animals already spawned in the nearby vicinity? I want to make the game harder by having to go to new chunks to tame animals.

This below won't do shit. It disables all the listed spawns completely. I even set the mincount to a 100 to see if anything spawns at all without any luck.

[
  {
    "dimension": 0,
    "mob": "pig",
    "mincount": {
      "amount": 100,
      "perchunk":true
    },
    "result": "deny"
  },
  {
    "dimension": 0,
    "mob": "minecraft:chicken",
    "mincount": {
      "amount": 100,
      "perchunk":true
    },
    "result": "deny"

    ... and the rest of the animals ...
]
MechanosG commented 4 years ago

As far as I know, there is no option currently to limit spawns local to a player (that's something I would love to have). The best you can do is use perchunk or perplayer to multiply whatever limit you set, then hope that RNG will spread them around among players. Perchunk actually does nearly the same thing as perplayer, except it multiplies the count based on the number of chunks loaded instead of the amount of players.

As for your code disabling spawns completely, what little code you showed me shouldn't kill all spawns. But I do see some possible problems. You didn't specify the mob inside mincount, so I assume it's counting all possible spawns. Aka, once there's 100/perchunk of anything, not just pigs, it starts denying their spawn. If I understand perchunk correctly, and you're using the default 10 view distance, that's..

Amount (ChunksLoaded/289) 100 ((10*2+1)/289) = 7.26 Edited to fix chunk math..

That would mean once there's 7 or 8 of anything in the game, your pigs and chickens will be denied.

In case I lost you anywhere, try this:

    {
        "dimension": 0,
        "mob": "minecraft:pig",
        "mincount": {
            "amount": 10,
            "mob": "minecraft:pig",
            "perplayer": true
        },
        "result": "deny"
    }

In theory that should allow 10 loaded pigs per player (so if 3 players join, 30 pigs can spawn). If you unload a chunk with pigs in it, it's possible the unloaded pigs will no longer count towards the amount, so a low "amount" number may force players to explore like you want. Unfortunately there isn't really a way to evenly distribute the pigs with this mod though (that I know of). For example, if one player finds some pigs and takes them back home, then breeds a bunch of them, they might take up all the available count and cause no more to spawn for anyone. Likewise, since pigs only spawn when new chunks are loaded, it means additional players that aren't exploring, will cause more animals to spawn for the ones that are exploring.

Due to these reasons, I've had to give up on using In Control for vanilla passive mob management in a multiplayer setting, with a few exceptions. Maybe in the future he'll add a way to control mobs locally or something that will achieve the same goal.

One last thing, it may be possible to disable vanilla mob spawns then create your own spawn rules using potentialspawn.json in order to better achieve the passive mob spawning you want. I'm thinking about attempting it in my own modpack.

AechtRob commented 4 years ago

I have a hunch that "mod": "minecraft" is not recognised. List the mobs one by one in an array or find some other way.