1 374
收录服务器
1 970
注册
27 283
玩家
FarmControl
农场限制器和总督。
作 者 froobynooby
发布时间 2020年12月21日
支持核心 Spigot
原生版本
支持版本 1.17,1.18,1.19,1.20
点此下载

🌾 FarmControl 插件介绍

FarmControl 是一个用于控制服务器上生物农场大小和其他属性的插件。它允许你管理动物农场和村民繁殖场的各种属性,例如禁用过度繁殖、减少不必要的随机移动、禁用农场中生物的AI以及限制农场中生物的数量。该插件高度可配置,且处理任务异步执行,对服务器性能影响较小。

🛠️ 功能特性

  • 禁用过度繁殖的动物农场和村民繁殖场的繁殖功能。
  • 减少农场中生物的不必要随机移动。
  • 禁用农场中生物的AI。
  • 限制农场中允许的生物数量。
  • 高度可配置,满足不同需求。
  • 低性能开销,处理任务异步执行。

📥 安装方法

将下载的 jar 文件放入服务器的插件目录即可安装该插件。安装后,请通过配置 config.yml 和 profiles.yml 文件(位于插件目录的 FarmControl 文件夹中)进行定制化设置。默认情况下,该插件仅会移除动物农场中生物的随机移动能力并禁用碰撞。

此插件需要 Java 17 运行环境。

⚙️ 配置文件

config.yml

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

# Please don't change this!
version: 7

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

# How long in ticks should we wait before starting the checking tasks following the plugin's start up?
#  * This is useful when using the 'reactive' mode where it is desirable to ignore the server's performance in the first
#    few minutes following a restart.
start-up-delay: 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:
    # Which profiles (as given in profiles.yml) should we run?
    profiles:
      # These profiles are constantly run.
      proactive:
        - soft-nerf-animal-farms
      #  - soft-limit-animal-farms
      #  - soft-limit-villager-breeders
      #  - 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:
      # Above what MSPT should the reactive mode be triggered?
      trigger-mspt-threshold: 45.0

      # Below what MSPT should the reactive mode be untriggered, and actions undone?
      untrigger-mspt-threshold: 35.0

      # 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 patrol leaders?
      patrol-leader: false

      # 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:
      #  - villager

      # 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: false

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

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

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

        remove-ai:
          interact: true

          damage: true

          target: true

        remove-awareness:
          interact: true

          damage: true

          target: true

        disable-collisions:
          tempt: true

        disable-breeding:
          # You have to interact with an animal to breed it, so never undo this action on interact.
          interact: false

          # Holding the food required to breed an animal will tempt it, so never undo this action on tempt.
          tempt: false

# These settings concern how we determine the server's MSPT.
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

profiles.yml

# 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

  # Disable breeding in farms containing 20 or more animals of the same type
  soft-limit-animal-farms:
    group:
      types:
        - "category:animal"
      count: 20
      distance: 5
      pure: true
    actions:
      - disable-breeding

  # Disable breeding in villager farms containing 20 or more villagers
  soft-limit-villager-breeders:
    group:
      types:
        - "villager"
      count: 20
      distance: 10
    actions:
      - disable-breeding

  # 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

📜 指令与权限

以下指令需要用户拥有 farmcontrol.command.farmcontrol 权限节点。

  • /farmcontrol reload - 重新加载插件配置。权限:farmcontrol.command.reload
  • /farmcontrol status <world> - 显示指定世界的状态。权限:farmcontrol.command.status
  • /farmcontrol history - 显示插件近期执行的操作。权限:farmcontrol.command.history
  • /farmcontrol notify - 切换插件的通知功能。权限:farmcontrol.command.notify

📊 数据统计

该插件使用 bStats 收集一些(非识别性)数据。你可以通过编辑服务器插件目录中的 bStats 文件夹内的 config.yml 文件来选择退出数据收集。