Giter Site home page Giter Site logo

froobynooby / farmcontrol Goto Github PK

View Code? Open in Web Editor NEW
44.0 4.0 13.0 272 KB

A plugin for controlling the size and other properties of farms.

Home Page: https://ci.froobworld.com/job/FarmControl/

License: MIT License

Java 100.00%
bukkit-plugin minecraft paper-plugin spigot-plugin

farmcontrol's Introduction

FarmControl

Hangar | Modrinth | Spigot

About

FarmControl is a Bukkit plugin that allows you to control certain properties of farms on your server.

Features:

  • Disable breeding in oversized animal farms and villager breeders.
  • Reduce unnecessary random movement within mob farms.
  • Disable the AI of mobs in farms.
  • Limit the number of entities allowed in an area.
  • Highly configurable - allowing you to tailor the plugin to your needs.
  • Low impact - with the brunt of the plugin's processing performed asynchronously.

Building

If you would like to build the plugin yourself you can follow these steps.

1. Clone FarmControl and build

git clone https://github.com/froobynooby/FarmControl
cd FarmControl
./gradlew clean build

2. Find jar in FarmControl/build/libs

farmcontrol's People

Contributors

exzolink avatar froobynooby avatar jsinco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

farmcontrol's Issues

cannot remove stacked mobs

paper 780 1.16.5
farmcontrol 1.1.8

Farm control cannot remove stacked mobs in chunks with its profiler actions.

The following profiler works for removing excess vanilla mobs, but does not work on stackers mobs, i use wildstacker in my server.

  soft-nerf-animal-farms:
    group:
      types:
        - "category:animal"
        - villager
        - "category:monster"
      count: 4
      distance: same-chunk
    actions:
      - remove

video demonstration:
https://youtu.be/OwYIyJ7_xbw

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

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

Improvement: add commands to actions

Ahoy

Please can you add a way to run commands as actions with placeholders for the action name and entities.

Then we can use it for things like testing actions to get feedback and logs.

For example I want to make a discord channel to log each time this changes, and if possible why, for example the entities that caused the action to happen.

So then we can be proactive with logging and look into where these are to see if it's a player or server issue that can be resolved.

Configurable message

Some of my players have been reaching the breeding limits, and they constantly asked me why.
I decided to change the message to clarify a little better, however, the message is hard coded!

Specifically the message that says "Breeding has been disabled for this animal."

Would be nice to have it configurable, for translation purposes, or clarification purposes.
Thanks in advance!

Have an action to disable all villager AI except for restocking & trading

I'm not sure if this is possible but it would greatly help for trading halls if there was an action that allowed for villagers to completely get rid of their AI except for trading and restocking. As villagers in trading halls are purely used for this, they are using way too much server resources by having their AI enabled.

Entity types not working

Certain entity types, such as minecart and splash_potion, don't work as expected and are being used to build lag machines.

The wiki for types indicates that an entity is an accepted value. This works as expected for mobs, but fails for some valid entities, including:

  • splash_potion
  • minecart (and varients)

I've tried using both kill and remove actions, and using a working type such as zombie in the same group, which works as expected

profiles.yml

profiles:
  limit-minecarts:
    group:
      types:
        - "MINECART"
        - "SPLASH_POTION"
      count: 2
      distance: 20
    actions:
      - kill

config.yml

world-settings:
  default:
    profiles:
      proactive:
        - limit-minecarts
      reactive: []
...

Some questions

  1. What is the difference between remove-awareness and remove-random-movement. I tried them both and it seems like it just made the animals in the farm stop moving. I wonder what remove-awareness does that is different to remove-random-movement in that case.

  2. I want to trim vehicles in a certain area with this profile, but it says this in console when I try to enable it

profiles.yml

  # No more than 6 vehicles per area
  trim-vehicles:
    group:
      types:
        - "category:vehicle"
      count: 6
      distance: 8
    actions:
      - kill

console

[22:49:27 WARN]: [FarmControl] Note: action 'kill' in profile 'trim-vehicles' is incompatible with the following entity types: category:vehicle
[22:49:27 WARN]: [FarmControl] Unknown entity type 'type:monster' for profile 'disable-mob-collection-ai'.
[22:49:27 WARN]: [FarmControl] Reactive mode is not supported on your version - ignoring reactive profiles for world 'world'
[22:49:27 WARN]: [FarmControl] Reactive mode is not supported on your version - ignoring reactive profiles for world 'world_nether'
[22:49:27 WARN]: [FarmControl] Reactive mode is not supported on your version - ignoring reactive profiles for world 'world_the_end'
[22:49:27 INFO]: Plugin reloaded.

[Suggestion] Disable dropping of items for purged entities.

Zombies in caves would bunch up, be killed by a purging profile, new zombie spawns would pick up the rotten flesh they had, and they would be marked as persistent. I might be doing some wrong things here, and I've changed the despawn rates for mob drops to be faster too.

May you add lobotomize and breeding delay features from PurpurMC, please?

Lobotomize completely kills villager's brain in 1x1 boxes.
Breeding delay adds possibility to increase breeding delay from 5 minutes.
I saw you messages about using Purpur, instead of adding this feature to plugin, but it seems that it would be easier to add
it's in one plugin than to download a separate server core with a billion patches to use only 2 features.
(translated with Google Translator)

support folia 1.20.4

[22:40:19 ERROR]: Thread Region Scheduler Thread #1 failed main thread check: Accessing entity state off owning region's thread
java.lang.Throwable: null
at io.papermc.paper.util.TickThread.ensureTickThread(TickThread.java:78) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftStrider.getHandle(CraftStrider.java:77) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftStrider.getHandle(CraftStrider.java:8) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity.isInWorld(CraftEntity.java:939) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity.isValid(CraftEntity.java:393) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.CraftRegionAccessor.lambda$getEntitiesByClasses$4(CraftRegionAccessor.java:373) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.bukkit.craftbukkit.v1_20_R3.CraftRegionAccessor.getEntitiesByClasses(CraftRegionAccessor.java:362) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at com.froobworld.farmcontrol.controller.task.TriggerCheckTask.run(TriggerCheckTask.java:65) ~[FarmControl-1.2.5.jar:?]
at com.froobworld.farmcontrol.hook.scheduler.RegionisedSchedulerHook.lambda$runRepeatingTask$1(RegionisedSchedulerHook.java:21) ~[FarmControl-1.2.5.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler$GlobalScheduledTask.run(FoliaGlobalRegionScheduler.java:179) ~[luminol-1.20.4.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler.tick(FoliaGlobalRegionScheduler.java:37) ~[luminol-1.20.4.jar:?]
at io.papermc.paper.threadedregions.RegionizedServer.globalTick(RegionizedServer.java:293) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at io.papermc.paper.threadedregions.RegionizedServer$GlobalTickTickHandle.tickRegion(RegionizedServer.java:148) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:404) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]
[22:40:19 WARN]: [FarmControl] Global task for FarmControl v1.2.5 generated an exception
java.lang.IllegalStateException: Accessing entity state off owning region's thread
at io.papermc.paper.util.TickThread.ensureTickThread(TickThread.java:79) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftStrider.getHandle(CraftStrider.java:77) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftStrider.getHandle(CraftStrider.java:8) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity.isInWorld(CraftEntity.java:939) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity.isValid(CraftEntity.java:393) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at org.bukkit.craftbukkit.v1_20_R3.CraftRegionAccessor.lambda$getEntitiesByClasses$4(CraftRegionAccessor.java:373) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.bukkit.craftbukkit.v1_20_R3.CraftRegionAccessor.getEntitiesByClasses(CraftRegionAccessor.java:362) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at com.froobworld.farmcontrol.controller.task.TriggerCheckTask.run(TriggerCheckTask.java:65) ~[FarmControl-1.2.5.jar:?]
at com.froobworld.farmcontrol.hook.scheduler.RegionisedSchedulerHook.lambda$runRepeatingTask$1(RegionisedSchedulerHook.java:21) ~[FarmControl-1.2.5.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler$GlobalScheduledTask.run(FoliaGlobalRegionScheduler.java:179) ~[luminol-1.20.4.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler.tick(FoliaGlobalRegionScheduler.java:37) ~[luminol-1.20.4.jar:?]
at io.papermc.paper.threadedregions.RegionizedServer.globalTick(RegionizedServer.java:293) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at io.papermc.paper.threadedregions.RegionizedServer$GlobalTickTickHandle.tickRegion(RegionizedServer.java:148) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:404) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525) ~[luminol-1.20.4.jar:git-Luminol-"59a428e"]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]

Adding other entities,

Would it be possble to add other entities as armor_stand, minecrat or item? Currently as far as i know they dont work.
It would be grat because we would be able to prevent griefers from lagging the server without using other plugins just for that.

Frog behavior not at all affected by remove-random-movement

Frogs jump behavior is a very laggy part of their AI for some reason, but is not required for most frog light farms to work.. For some reason, the action, remove-random-movement doesn't attempt to stop them from jumping when I believe that it very much should try too. The action applying to frogs would cut down their lag by about half, I can provide spark reports showing FarmControl is not handling this interaction.

Unfreeze mobs

I was updating to 1.17 so I replaced SAML with FarmControl and now my mobs remain frozen even though I set the config up so that on interaction they would unfreeze. any ideas?

config

# Configuration for FarmControl.
# Plugin page: https://www.spigotmc.org/resources/86923/
# GitHub: https://github.com/froobynooby/FarmControl

# Please don't change this!
version: 3

# Every how many ticks should we run the profile check / action cycle?
cycle-period: 600

# These settings can be specified per world.
#  * Note: If a world is not specified or if a setting is missing, it will use the settings listed under the default
#    section.
world-settings:
  default:
    # Which profiles (as given in profiles.yml) should we run?
    profiles:
      # These profiles are constantly run.
      proactive:
        - soft-nerf-animal-farms
      #  - trim-animal-farms
      #  - trim-sparse-animal-farms

      # These profiles only run when the server is performing poorly and are progressively undone as performance
      # improves (as defined under the reactive-mode-settings).
      #  * Note: It is generally preferable to ensure your server's performance doesn't degrade in the first place,
      #    rather than try to mitigate it. That said, there are some reasonable use cases for this mode, such as
      #    allowing your players to keep larger farms at the cost of nerfing them when performance begins to degrade.
      reactive:
      #  - hard-nerf-animal-farms
      #  - freeze-animal-farms

    # These settings concern the reactive mode for triggering profile check / action cycles.
    reactive-mode-settings:
      # Below what TPS should the reactive mode be triggered?
      trigger-tps-threshold: 18.0

      # Above what TPS should the reactive mode be untriggered, and actions undone.
      untrigger-tps-threshold: 19.9

      # These settings concern how the plugin should handle undoing actions performed on mobs once the reactive mode has
      # been untriggered.
      untrigger-settings:
        # How many cycles of the reactive mode being untriggered should have to pass before any actions are undone?
        minimum-cycles-before-undo: 10

        # At most how many mobs should have their actions undone per cycle?
        maximum-undos-per-cycle: 40

        # How much should an entity contribute to the maximum-undos-per-cycle limit?
        #  * For example, if maximum-undos-per-cycle was 40 and the entity-undo-weight for villagers was 5, at most 8
        #    villagers could have their actions undone (since 5 * 8 = 40).
        #  * If an entity type is not specified, the value under default will be used.
        entity-undo-weight:
          default: 1
          villager: 5

    # These settings concern when we should exclude a mob from having actions applied to them.
    exclusion-settings:
      # Should we not perform actions on tamed mobs?
      tamed: true

      # Should we not perform actions on named mobs?
      named: true

      # Should we not perform actions on mobs in love-mode (breeding animals)?
      love-mode: true

      # Should we not perform actions on mobs that are leashed?
      leashed: true

      # Should we not perform actions on mobs that are younger than this value (in ticks)?
      younger-than: 0

      # Which types of mobs should we not perform actions on?
      type:
        - dog
        - pig

      # For which metadata should we not perform actions on a mob?
      #  * Some plugins will add metadata to mobs that they spawn or use. This setting allows you to exclude those mobs
      #    from having actions performed on them by this plugin.
      metadata:
        - Elitemob # Elite mobs from the plugin EliteMobs.
        - Elitemobs_NPC # NPCs from the plugin EliteMobs.
        - Supermob # Super mobs from the plugin EliteMobs.
        - infernalMetadata # Infernal mobs from the plugin InfernalMobs.
        - NPC # NPCs from the plugin Citizens.
        - shopkeeper # Shopkeepers from the plugin Shopkeepers.

    # These settings concern properties of actions.
    action-settings:
      # These settings concern when an action should be undone, and can be specified per action.
      #  * Note: If an action is not specified, or if an option is blank, the settings listed under default will be
      #    used.
      undo-on:
        default:
          # Should we undo this action when the mob is interacted with?
          interact: true

          # Should we undo this action when the mob is damaged?
          damage: true

          # Should we undo this action when the mob is targeted by another entity (e.g. a zombie targeting a villager)?
          target: true

          # Should we undo this action when the mob is tempted by a player (e.g. a cow tempted a player holding wheat)?
          tempt: true

        remove-ai:
          interact: true

          damage: true

          target: true

        remove-awareness:
          interact: true

          damage: true

          target: true

        disable-collisions:
          tempt: true

# These settings concern how we determine the TPS.
#  * Only touch these settings if you know what you're doing.
tps-tracker-settings:
  # Over how many ticks should we collect tick durations for calculating the TPS?
  #  * Setting this too high will make the TPS very slow to react to changes.
  #  * Setting this too low will make the TPS volatile.
  collection-period: 1200

  # By how much (in percent) should we allow the tick durations we use to calculate the TPS vary from the average
  # tick duration.
  #  * This is used for smoothing the TPS; making sure it's not heavily affected by sudden large lag spikes, such as
  #    those caused by garbage collections or world-saves.
  #  * Setting this to 0 will mean your TPS will never change - don't do that.
  trim-outliers-to-within: 100.0

# These are additional settings that apply if you are using Paper as your server software.
paper-settings:
  # These settings concern how we determine the server's MSPT.
  #  * Only touch these settings if you know what you're doing.
  mspt-tracker-settings:
    # Over how many ticks should we collect tick durations for calculating the MSPT?
    #  * Setting this too high will make the MSPT very slow to react to changes.
    #  * Setting this too low will make the MSPT volatile.
    collection-period: 1200

    # By how much (in percent) should we allow the tick durations we use to calculate the MSPT vary from the average
    # tick duration.
    #  * This is used for smoothing the MSPT; making sure it's not heavily affected by sudden large lag spikes, such
    #    as those caused by garbage collections or world-saves.
    #  * Setting this to 0 will mean your MSPT will never change - don't do that.
    trim-outliers-to-within: 100.0

  # These settings can be specified per world.
  #  * Note: If a world is not specified or if a setting is missing, it will use the settings listed under the default
  #    section.
  world-settings:
    default:
      # These are alternative settings for reactive-mode if you are using Paper, allowing the use of MSPT over TPS.
      alternative-reactive-mode-settings:
        # Should these alternative settings be used?
        use-alternative-settings: false

        # Above what MSPT should the reactive-mode be triggered?
        trigger-mspt-threshold: 47.0

        # Below what MSPT should the reactive-mode be untriggered?
        untrigger-mspt-threshold: 40.0

profiles

# Please visit https://github.com/froobynooby/FarmControl/wiki/Profiles for help with making profiles.

profiles:
  # Remove random movements and disable collisions of mobs in animal farms
  soft-nerf-animal-farms:
    group:
      types:
        - "category:animal"
      count: 15
      distance: 5
    actions:
      - remove-random-movement
      - disable-collisions

  # Remove the awareness of mobs in animal farms
  hard-nerf-animal-farms:
    group:
      types:
        - "category:animal"
      count: 15
      distance: 5
    actions:
      - remove-awareness
      - disable-collisions

  # Remove the AI of mobs in animal farms
  freeze-animal-farms:
    group:
      types:
        - "category:animal"
      count: 15
      distance: 5
    actions:
      - remove-ai
      - disable-collisions

  # No more than 20 animals (all of the same type) within close proximity
  trim-animal-farms:
    group:
      types:
        - "category:animal"
      count: 21
      distance: 5
      pure: true
    actions:
      - kill

  # No more than 50 animals (all of the same type) sparsely placed (within 160 blocks of each other)
  trim-sparse-animal-farms:
    group:
      types:
        - "category:animal"
      count: 51
      distance: 160
      pure: true
    actions:
      - kill

  # No more than 10 villagers per chunk
  trim-villager-chunks:
    group:
      types:
        - "villager"
      count: 11
      distance: same-chunk
    actions:
      - kill

Undo actions on player radius

Option to undo actions if a player is within a distance of the entity, would be very nice to make entities feel more 'alive', while still optimizing mobs that are not in the immediate vicinity of the player.

      undo-on:
        default:
          # Should we undo this action when the mob is interacted with?
          interact: true
          # Should we undo this action when a player is within a specified distance?
          # radius: <radius-xz> <radius-y>

Suggestion: per config nametag value

This is a suggestion that would be incredebly beneficial to our server. I don't want FarmControl to either take ALL or NONE nametagged mobs, but only mobs I choose.
For example, I want FarmControl to kill named Villagers, but not named Zombies, if that makes sense?

From my understanding, it's not possible to choose which mob-type is killed with nametag or not, and that is a feature I would love to see.

[Bug] Animals disappearing after exception while default ''

Server: Purpur 1.16.5 build 1064
Farmcontrol version: 1.1.3
Other plugins that do have animal stuff, most on the standard settings: GriefPrevention, Terra, WorldGuard

After spawning 30 sheep

next to eachother and enabling the default 'soft-nerf-animal-farms' profile, the server will throw an exception that makes most of the sheep disappear

STR:

  • Change the soft-nerf-animal-farms profile count to 1500, /farmcontrol reload
  • spawn 30 sheep in a small area with fences
  • wait, sheeps are not despawning
  • change the count back to 15, /farmcontrol reload
  • after a small bit, the server code itself starts spitting exceptions and a lot of the animals are despawning

Error in the console:

[23:38:45 WARN]: Entity threw exception at world:-1055.925000011921,70.0,462.14596286640847
[23:38:45 WARN]: java.util.ConcurrentModificationException
[23:38:45 WARN]:        at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719)
[23:38:45 WARN]:        at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:741)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.PathfinderGoalSelector.doTick(PathfinderGoalSelector.java:109)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityInsentient.inactiveTick(EntityInsentient.java:207)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityAgeable.inactiveTick(EntityAgeable.java:30)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.WorldServer.entityJoinedWorld(WorldServer.java:1541)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.WorldServer.doTick(WorldServer.java:1143)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1563)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:433)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1412)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1138)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291)
[23:38:45 WARN]:        at java.base/java.lang.Thread.run(Thread.java:834)
[23:38:45 WARN]: Entity threw exception at world:-1049.5075544036852,70.0,459.6014259991778
[23:38:45 WARN]: java.util.ConcurrentModificationException
[23:38:45 WARN]:        at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719)
[23:38:45 WARN]:        at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:741)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.PathfinderGoalSelector.doTick(PathfinderGoalSelector.java:109)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityInsentient.inactiveTick(EntityInsentient.java:207)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityAgeable.inactiveTick(EntityAgeable.java:30)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.WorldServer.entityJoinedWorld(WorldServer.java:1541)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.WorldServer.doTick(WorldServer.java:1143)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1563)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:433)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1412)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1138)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291)
[23:38:45 WARN]:        at java.base/java.lang.Thread.run(Thread.java:834)
[23:38:45 WARN]: Entity threw exception at world:-1049.3033855601473,70.0,462.6299424535344
[23:38:45 WARN]: java.util.ConcurrentModificationException
[23:38:45 WARN]:        at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719)
[23:38:45 WARN]:        at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:741)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.PathfinderGoalSelector.doTick(PathfinderGoalSelector.java:109)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityInsentient.doTick(EntityInsentient.java:882)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityLiving.movementTick(EntityLiving.java:2922)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityInsentient.movementTick(EntityInsentient.java:652)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityAgeable.movementTick(EntityAgeable.java:152)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityAnimal.movementTick(EntityAnimal.java:60)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntitySheep.movementTick(EntitySheep.java:163)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityLiving.tick(EntityLiving.java:2648)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.EntityInsentient.tick(EntityInsentient.java:406)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.WorldServer.entityJoinedWorld(WorldServer.java:1539)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.WorldServer.doTick(WorldServer.java:1143)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1563)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:433)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1412)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1138)
[23:38:45 WARN]:        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291)
[23:38:45 WARN]:        at java.base/java.lang.Thread.run(Thread.java:834)

Used FarmControl config:

version: 3
cycle-period: 600
world-settings:
  default:
    profiles:
      proactive:
        - soft-nerf-animal-farms
      reactive:
    reactive-mode-settings:
      trigger-tps-threshold: 18.0
      untrigger-tps-threshold: 19.9
      untrigger-settings:
        minimum-cycles-before-undo: 10
        maximum-undos-per-cycle: 40
        entity-undo-weight:
          default: 1
          villager: 5
    exclusion-settings:
      tamed: true
      named: true
      love-mode: true
      leashed: true
      younger-than: 0
      type:
      metadata:
        - Elitemob
        - Elitemobs_NPC
        - Supermob
        - infernalMetadata
        - NPC
        - shopkeeper
    action-settings:
      undo-on:
        default:
          interact: false
          damage: true
          target: true
          tempt: true
        remove-ai:
          interact: true
          damage: true
          target: true
        remove-awareness:
          interact: true
          damage: true
          target: true
        disable-collisions:
          tempt: true
tps-tracker-settings:
  collection-period: 1200
  trim-outliers-to-within: 100.0
paper-settings:
  mspt-tracker-settings:
    collection-period: 1200
    trim-outliers-to-within: 100.0
  world-settings:
    default:
      alternative-reactive-mode-settings:
        use-alternative-settings: false
        trigger-mspt-threshold: 47.0
        untrigger-mspt-threshold: 40.0

profiles.yml is stock except for the count change listed in the STR

[Suggestion] Control mobs spawn according to TPS or MSPT

Add a system that controls the chance of spawned mobs according to tps or mspt for PaperMC users.
Being able to select the reason for the spawn.
Example:

# Settings related to global mob spawning on the server
mob-spawning:
  # Chance to spawn mobs (percentage) at a specific TPS or MSPT?
    20: 100
    19: 75
    18: 50
    17: 35
    16: 25
    15: 15
    14: 10
    13: 5
    12: 3
    11: 1
    10: 0
    9: 0
    8: 0
    7: 0
    6: 0
    5: 0
    4: 0
    3: 0
    2: 0
    1: 0
    0: 0
  spawnreason-tps-block:
    - DROWNED
    - NATURAL
    - SPAWNER

Slime nerf dont work

Hello is this code valid? i 'm trying to nerf slime in my workd but dont work

nerf-slime:
group:
types:
- "slime"
count: 5
distance: same-chunk
actions:
- kill

Suggestion: Notify/Command in actions.

https://github.com/froobynooby/FarmControl/wiki/Actions

Can I request another type of action, to notifiy or command to be run, so we can run our own Notifiy.

I have an issue where I have a 9 year old world with on average 700 Villagers loaded at once.. I know... This is a major problem, and if I run a full on kill for X amount in a chunk there will be utter hell to pay.

What I would like to do, is give players a chance to cleanup their own villagers first, this would require the plugin detecting X amount of villagers in a space/chunk and tell the people in that radius that they need to be cleaned up.

Now you have the notificaiton system, this could lean on that!

So each profile can have a notfication action.

Alternativly, running a command could work and I could use something like CMI to send rawtext, but it would require the placeholders for the profile its notifying about, such as the mob name(s) and how many over a limit they are.

Bats not being removed

  bat:
    group:
      types:
        - "bat"
    actions:
      - remove
world-settings:
  default:
    profiles:
      proactive:
        - bat

But I still see bats flying around having a holly jolly time.

Raid mobs category, or custom ones.

Will make optimizations for raid farms a lil bit easier to separate, since you'd want to this for most uses anyway for a survival server.
Would be extremely nice-- custom categories of mobs, maybe in a separate groups.yml file.

WolfControl

Another one from MFM:
Please add a way to limit Wolfs per person.

WolfControl:
  #  
  # Checks tamed wolfs in defined chunk range and if its above allowed limit then makes them sit down
  # This is limit per player so value of 2-3 is more than enough
  Enabled: true
  # Defines max allowed wolfs per player which can follow him
  # This will be checked on general entity amount check defined belove
  Max: 5

cant nerf zombified piglin from nether portal

same-monster-toomany:
group:
types:
- "zombified_piglin"
- "category:monster"
count: 51
distance: 100
pure: true
actions:
- remove

just remove like zombie, skeleton...etc.
but zombified piglin from nether portal wont be removed

Notificaiton to staff when mobs are cleaned up

Can we please get a notification when mobs are cleaned up, or an option to run a command when the action happens in the config with the variable of how many/what mobs were cleaned.
Mobfarmmanager does this by saying X mobs were clenaed up then you hover over and it tells you what mobs they were.

Issue with wildstacker

I activated an auto-kill on chicken :

trim-chicken-chunks:
group:
types:
- "chicken"
count: 25
distance: 20
actions:
- kill

But the chickens are stacked, and it kills only 1 chicken on the stack, instead of killing the whole stack.
So if I stack chicken up to x64, it will make "chicken x63" after it kills it, so it needs to scan 64 times the chickens to kill all the stack.

Wildstacker is open source and has an API, it wouldn't be dificult to add support for it :
https://github.com/BG-Software-LLC/WildStacker

Forge-Version

Is there any chance to get this as a forge compatible mod? Helps a lot on my spigot server, but I'm currently having thoses issues in modded Minecraft.
There does not seem to be a mod of this kind yet.

Folia Errors

[23:40:47 WARN]: [FarmControl] Global task for FarmControl v1.2.5 generated an exception
java.lang.IllegalStateException: Accessing entity state off owning region's thread
at io.papermc.paper.util.TickThread.ensureTickThread(TickThread.java:79) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftWolf.getHandle(CraftWolf.java:35) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftWolf.getHandle(CraftWolf.java:7) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity.isInWorld(CraftEntity.java:939) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity.isValid(CraftEntity.java:393) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at org.bukkit.craftbukkit.v1_20_R3.CraftRegionAccessor.lambda$getEntitiesByClass$3(CraftRegionAccessor.java:350) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.bukkit.craftbukkit.v1_20_R3.CraftRegionAccessor.getEntitiesByClass(CraftRegionAccessor.java:341) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at com.froobworld.farmcontrol.controller.task.TriggerCheckTask.run(TriggerCheckTask.java:65) ~[FarmControl-1.2.5.jar:?]
at com.froobworld.farmcontrol.hook.scheduler.RegionisedSchedulerHook.lambda$runRepeatingTask$1(RegionisedSchedulerHook.java:21) ~[FarmControl-1.2.5.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler$GlobalScheduledTask.run(FoliaGlobalRegionScheduler.java:179) ~[folia-1.20.4.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler.tick(FoliaGlobalRegionScheduler.java:37) ~[folia-1.20.4.jar:?]
at io.papermc.paper.threadedregions.RegionizedServer.globalTick(RegionizedServer.java:293) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at io.papermc.paper.threadedregions.RegionizedServer$GlobalTickTickHandle.tickRegion(RegionizedServer.java:148) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:404) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525) ~[folia-1.20.4.jar:git-Folia-"e97b1ee"]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]

Does not work anymore (1.18.2)

Plugin no longer works in 1.18.2. Produces the below error:

[15:47:34] [Server thread/INFO]: [FarmControl] Enabling FarmControl v1.2.0
[15:47:34] [Server thread/WARN]: java.lang.NullPointerException: Cannot invoke "com.froobworld.farmcontrol.lib.nabconfiguration.utils.InstantFallbackConfigurationSection.getSection(String, String)" because "this.fallbackSection" is null
[15:47:34] [Server thread/WARN]: at FarmControl-1.2.0.jar//com.froobworld.farmcontrol.lib.nabconfiguration.utils.InstantFallbackConfigurationSection.getSection(InstantFallbackConfigurationSection.java:36)
[15:47:34] [Server thread/WARN]: at FarmControl-1.2.0.jar//com.froobworld.farmcontrol.lib.nabconfiguration.ConfigSectionPopulator.populate(ConfigSectionPopulator.java:46)
[15:47:34] [Server thread/WARN]: at FarmControl-1.2.0.jar//com.froobworld.farmcontrol.lib.nabconfiguration.NabConfiguration.load(NabConfiguration.java:31)
[15:47:34] [Server thread/WARN]: at FarmControl-1.2.0.jar//com.froobworld.farmcontrol.FarmControl.onEnable(FarmControl.java:26)
[15:47:34] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[15:47:34] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[15:47:34] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:501)
[15:47:34] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:559)
[15:47:34] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:473)
[15:47:34] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:664)
[15:47:34] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431)
[15:47:34] [Server thread/WARN]: at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:316)
[15:47:34] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1163)
[15:47:34] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315)
[15:47:34] [Server thread/WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
[15:47:34] [Server thread/ERROR]: Error occurred while enabling FarmControl v1.2.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "com.froobworld.farmcontrol.lib.nabconfiguration.ConfigEntry.get()" is null
at com.froobworld.farmcontrol.HookManager.load(HookManager.java:25) ~[FarmControl-1.2.0.jar:?]
at com.froobworld.farmcontrol.FarmControl.onEnable(FarmControl.java:31) ~[FarmControl-1.2.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:501) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:559) ~[paper-1.18.2.jar:git-Paper-274]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:473) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:664) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-274]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[15:47:34] [Server thread/INFO]: [FarmControl] Disabling FarmControl v1.2.0
[15:47:34] [Server thread/ERROR]: Error occurred while disabling FarmControl v1.2.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "com.froobworld.farmcontrol.controller.FarmController.unRegister()" because "this.farmController" is null
at com.froobworld.farmcontrol.FarmControl.onDisable(FarmControl.java:75) ~[FarmControl-1.2.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:399) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:538) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:374) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:501) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:559) ~[paper-1.18.2.jar:git-Paper-274]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:473) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:664) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-274]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-274]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

cramming not working for farmcontrol affected mobs

hey i have a problem with farmcontrol! if mobs get affected by farmcontrol the cramming rule wont work anymore pls fix this! if u need more info my discord is Tizo#5051 im more active on discord then on github

[bug] potential memory leak

hi, i am alaysising my server's memory leak problem, i use eclipse memory analyser and found out that , farm control is one of the leak problem suspect.

please check the picture below..

image

Console error

image
image
i dont exactly know what it means and i couldnt find any support so im sending it here
latest version
mc: 1.20.x paper

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.