froobynooby / FarmControl

A plugin for controlling the size and other properties of farms.
https://ci.froobworld.com/job/FarmControl/
MIT License
42 stars 13 forks source link

EntitySpawn (Chunk checking) event to prevent mobs being created in the first place. #16

Closed TomLewis closed 1 year ago

TomLewis commented 2 years ago

Zrips MobFarmManager has a setting called EntitySpawn which checks the chunk the user is spawning/farming animals in to see if its already reached the maximum allowed entities check. This is extremely important for users, if they are sitting there breeding animals for ages, and they suddenly disappear with no message to tell them why, they freak out and scream there are issues with the server. 2 ways to solve this.

1) have a pre-checker "EntitySpawn" to stop the mobs being created in the first place, this just gives them a warning in-game that they have reached the maximum amount of that mob for the area they are in. 2) Give players feedback if they are in an area that had mobs butchered, so they know what's going on.

This is the config from MobFarmManager.

EntitySpawn:
  #  
  # Checks Chunk when entity spawns
  Check: true
  # When set to true players without permissions: mfm.build.wither mfm.build.irongolem mfm.build.snowman will be prevented from building appropriate monsters
  PreventMobBuild: false
  # When set to true iron golems in villages will not spawn throw natural means
  PreventIronGolemSpawn: false
  # If this set to true, chunks will be grouped up and counted as one. In example with range 2 all 9 (3x3) chunks will be counted as one and limits will be used as for one chunk
  # This will give wider range of mob cleaning
  GroupChunks: false
  GroupChunksRadius: 1
#  
# When set to true entities which are above allowed limit will get removed
# Disabling this will prevent entities from disappearing in front of your eyes, but this can allow player from stacking dozens or even hundreds of mobs in one chunk throw multiple methods
# Disable at your own risk
RemoveExisting: true
froobynooby commented 1 year ago

I'm going to call this closed with 92775be7e8a142679d9114dac1e574ca6214a766. I think this is the best that can be done within the plugin's existing framework