McJtyMods / InControl

Be In Control of Mob Spawns and others
MIT License
44 stars 16 forks source link

[1.18.2] Crash/Freeze game with "mincount" #336

Open BlackAures1 opened 2 years ago

BlackAures1 commented 2 years ago

With some chance the game crashes or stops (no crash report) when trying to block untamedwilds spawns. As I remember the entities from this mod spawn as passive creatures and appear as part of the world generation. After removing the limit of 10 pieces per chunk, the game stopped stopping. Crashes occurred not regularly, but with some chance, when moving quickly through the not yet explored parts of the map. More details in the crash report.

Spawner

[
  {
    "mob": ["minecraft:cod", "minecraft:salmon"],
    "persecond": 0.1,
    "attempts": 10,
    "amount": {
      "minimum": 1,
      "maximum": 2
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  },
  {
    "mob": ["untamedwilds:catfish", "aquaculture:bayad", "aquaculture:catfish"],
    "persecond": 0.1,
    "attempts": 10,
    "amount": {
      "minimum": 1,
      "maximum": 2
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  },
  {
    "mob": ["untamedwilds:shark"],
    "persecond": 0.1,
    "attempts": 5,
    "amount": {
      "minimum": 1,
      "maximum": 1
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  },
  {
    "mob": ["minecraft:drowned"],
    "persecond": 0.1,
    "attempts": 5,
    "amount": {
      "minimum": 1,
      "maximum": 1
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  }
]

Spawn

[
  {
    "mob": ["minecraft:zombie"],
    "dimension": "minecraft:overworld",
    "minheight": 60,
    "result": "deny"
  },
  {  
  "dimension": "minecraft:overworld",
  "mod": "untamedwilds",
  "mincount": {  "amount": 10,
  "mod": "untamedwilds",
  "perchunk": true  },
  "result": "deny"
  }
]

Crash file: crash-2022-07-17_17.03.27-server.txt

McJty commented 2 years ago

I will check it out soon. Thanks for reporting

McJty commented 2 years ago

The problem is most likely in Untamed Wilds. It is spawning mobs in its feature placement which is very unsafe to do so. There is nothing that I can do to fix this on InControl's end. You might be able to get around this by adding "onjoin": true to the rule with mincount

BlackAures1 commented 2 years ago

So far I've just done this and the problem hasn't come up yet. I was worried about the excessive number of fish when staying in one place for a long time, but now this is no longer the case and I can remove the mincount.

[
  {
    "mob": ["minecraft:zombie"],
    "dimension": "minecraft:overworld",
    "minheight": 60,
    "result": "deny"
  },
  {
    "mob": ["creeperoverhaul:snowy_creeper"],
    "dimension": "minecraft:overworld",
    "mincount": {  "amount": 20,
    "mob": ["creeperoverhaul:snowy_creeper"],
    "perplayer": true  },
    "result": "deny"
  },
  {
    "dimension": "minecraft:overworld",
    "hostile": true,
    "mincount": {
      "amount": 20,
      "hostile": true,
      "perchunk": true
    },
    "result": "deny"
  }
]

Spawner

[
  {
    "mob": ["minecraft:cod", "minecraft:salmon"],
    "persecond": 0.1,
    "attempts": 10,
    "amount": {
      "minimum": 1,
      "maximum": 2
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  },
  {
    "mob": ["aquaculture:bayad", "aquaculture:catfish"],
    "persecond": 0.1,
    "attempts": 10,
    "amount": {
      "minimum": 1,
      "maximum": 2
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  },
  {
    "mob": ["untamedwilds:shark"],
    "persecond": 0.1,
    "attempts": 2,
    "amount": {
      "minimum": 1,
      "maximum": 1
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  },
  {
    "mob": ["minecraft:drowned"],
    "persecond": 0.1,
    "attempts": 5,
    "amount": {
      "minimum": 1,
      "maximum": 1
    },
    "conditions": {
      "dimension": "minecraft:overworld",
      "inwater": true,
      "mindist": 25,
      "maxdist": 100,
      "maxheight": 30
    }
  }
]
RayTrace082 commented 1 year ago

Hey there, I'm the modder behind UntamedWilds, I have been linked to this issue and would be interested in fixing/adressing it on my end if possible

The problem is most likely in Untamed Wilds. It is spawning mobs in its feature placement which is very unsafe to do so

I'm not happy with this approach either, but couldn't (and still can't) think of any other way to achieve what I wanted; non-respawning mobs that pull from a set of data-driven lists, do you have any suggestions as to a safer way to approach the problem? I don't think full InControl compatibility can be possible without some massive reworks, given how I ignore Minecraft's spawn system altogether, but I'd still like to try to handle some of the common cases if it's reasonable to implement

There's always the choice of just fully disabling my own spawning through the config, and having InControl handle everything, or using a datapack to prevent certain mobs from spawning

McJty commented 1 year ago

Thanks for answering to this. I'm also not sure how to tackle this problem but it's nice that there is a workaround at least

BlackAures1 commented 1 year ago

I'll add. The parameter "onjoin" does not help and crashes still happen, so I used another way to reduce the spawning of my required mobs. (datapacks)