Create a new crop

Take tomato as an example, read it would let you know how the system works. Crops are stored in /CustomCrops/contents/crops/ folder.

# Crop key name
# 农作物配置名
tomato:
  # Crop mode, make sure that type is consistent with IA/Oraxen configs
  # Otherwise some unexpected problems would occur
  # TRIPWIRE / ITEM_FRAME / ITEM_DISPLAY (1.19.4+)
  # 农作物模式,请确保和你的资源包配置等一致,否则会出现bug
  type: TRIPWIRE

  # The crop can only be planted on certain pots
  # Pot are stored in /CustomCrops/contents/pots
  # 农作物只能在指定的种植盆中种植
  pot-whitelist:
    - default

  # Crop's seed, if you want to use Vanilla items, just use Capital letters. (Example APPLE)
  # 农作物的种子,如果你想用原版物品做种子,就使用大写字母
  seed: customcrops:tomato_seeds

  # break/plant requirements
  # 破坏/种植农作物的需求
  requirements:
    break:
      requirement_1:
        # Requirement type, you can get a full list of requirements on wiki page
        # 需求类型,wiki中有详细的全部需求类型和示范
        type: permission
        value: tomato.break
        # The message to show when not meeting the requirement(Supports multiple lines)
        # 不满足需求的提示,支持多行
        message: "You don't have permission to harvest the tomato"
    plant:
      requirement_1:
        type: permission
        value: tomato.plant
        message: "You don't have permission to plant the tomato"
      requirement_2:
        type: season
        value:
          - Spring
          - Autumn
        message: "It's not a good season to plant tomato"

  # plant actions
  # 种植时发生的动作
  plant-actions:
    action_1:
      # Requirement type, you can get a full list of actions on wiki page
      # 动作类型,wiki中有详细的全部动作类型和示范
      type: sound
      value:
        source: player
        key: minecraft:item.hoe.till
        volume: 1
        pitch: 1

  # This decides when the crop data would be removed from cache
  # 这决定了农作物数据什么时候从缓存中移除
  max-points: 6
  # What should a crop do when gaining a certain amount of points
  # 农作物在获取指定生长点数时候执行的动作
  points:
    0:
      # change the crop's model
      # 改变农作物的模型
      model: customcrops:tomato_stage_1
      # As crop's models are different and have various height
      # So sometimes the pot information hologram can't show in a proper place
      # Set "hologram-offset-correction" to a high value would increase the
      # vertical position of the hologram
      # 因为不同农作物有不同的模型高度,所以在显示悬浮信息的时候,可能会导致模型遮挡了悬浮信息
      # 因此设置 "hologram-offset-correction" 为更大值可以提升悬浮字的高度,以免遮挡
      hologram-offset-correction: 0.2
      # Available events: break/grow/interact-by-hand/interact-with-item
      events:
        break:
          action_1:
            type: drop-items
            value:
              other-items:
                loot_1:
                  # Other plugin item compatibility(Can also be used in quality-crops)
                  # MMOItems:TYPE:ID
                  # MythicMobs:id
                  # NeigeItems:id
                  item: customcrops:tomato_seeds
                  min: 1
                  max: 1
                  # 0-1
                  chance: 0.3
          action_2:
            type: sound
            value:
              source: player
              key: minecraft:block.crop.break
              volume: 1
              pitch: 1
    1:
      model: customcrops:tomato_stage_2
      hologram-offset-correction: 0.2
      events:
        break:
          action_1:
            type: drop-items
            value:
              other-items:
                loot_1:
                  item: customcrops:tomato_seeds
                  min: 1
                  max: 1
                  chance: 0.5
          action_2:
            type: sound
            value:
              source: player
              key: minecraft:block.crop.break
              volume: 1
              pitch: 1
    3:
      model: customcrops:tomato_stage_3
      hologram-offset-correction: 0.2
      events:
        break:
          action_1:
            type: drop-items
            value:
              other-items:
                loot_1:
                  item: customcrops:tomato_seeds
                  min: 1
                  max: 1
                  chance: 0.8
          action_2:
            type: sound
            value:
              source: player
              key: minecraft:block.crop.break
              volume: 1
              pitch: 1
    5:
      model: customcrops:tomato_stage_4
      hologram-offset-correction: 0.2
      events:
        break:
          action_1:
            type: command
            value:
              - 'say Hello, {player}!'
            chance: 0.5
          action_2:
            type: sound
            value:
              source: player
              key: minecraft:block.crop.break
              volume: 1
              pitch: 1
          action_3:
            type: drop-items
            value:
              quality-crops:
                min: 1
                max: 4
                items:
                  1: customcrops:tomato
                  2: customcrops:tomato_silver_star
                  3: customcrops:tomato_golden_star
              other-items:
                loot_1:
                  item: customcrops:tomato_seeds
                  min: 1
                  max: 1
                  chance: 1
        grow:
          action_1:
            type: variation
            value:
              golden:
                item: customcrops:tomato_stage_golden
                type: TRIPWIRE
                chance: 0.01
        interact-by-hand:
          requirements:
              requirement_1:
                type: permission
                value: tomato.harvest
                message: "You don't have permission to harvest tomato."
          action_1:
            type: break
            value: true # whether to trigger break event too 是否触发break事件
          action_2:
            type: replant
            value:
              point: 0
              crop: tomato  # Replant the crop 重新种植农作物
              model: customcrops:tomato_stage_1 # crop model 农作物模型
        interact-with-item:
          interact_1:
            # the item to use (use "*" for any item, example: item: "*")
            # 使用的物品
            item: customcrops:i_want_overgrown_tomato_right_now
            # whether to reduce the amount
            # 是否减少数量
            reduce-amount: true
            # the item to return, remove this section if you don't want item back
            # 返还的物品,如果你不想要返还物品,请删除此项目
            return: customcrops:returned_item
            # requirements
            # 使用条件
            requirements:
              requirement_1:
                type: permission
                value: golden_hoe.use
                message: "You don't have permission to use golden hoe."
            # actions to perform
            # 执行的动作
            actions:
              action_1:
                type: variation
                value:
                  gigantic:
                    item: customcrops:gigantic_tomato
                    type: CHORUS
                    chance: 1
    6:
      # In this example, the model is not set, so the crop would not change its model
      # when reaching this point. But here's a section called variation, which means that
      # the crop has a little chance to be gigantic when it's already ripe. Since it reaches
      # "max-points", the crop data would be removed from data and no longer affect server performance
      # 在这个示范中,model没有被设置,因此,农作物不会在此生长点数时替换模型
      # 但是这里有一个生长时候触发的变异动作,意味着农作物有小概率在此阶段发生变异
      # 因为农作物已经达到了最大生长点数,农作物数据将自此从数据中移除,不再对服务器性能造成影响
      events:
        grow:
          action_1:
            type: variation
            value:
              gigantic:
                item: customcrops:gigantic_tomato
                type: CHORUS
                chance: 0.02

    # The crop would actually not gain so many points
    # But you can set some special crops' loots here
    # 农作物实际上并不会获取这么多生长点数,但是你可以在此设置一些特殊掉落物
    99:
      model: customcrops:tomato_stage_golden
      events:
        break:
          action_1:
            type: drop-items
            value:
              other-items:
                loot_1:
                  item: customcrops:golden_tomato
                  min: 1
                  max: 1
                  chance: 1
                loot_2:
                  item: customcrops:golden_tomato
                  min: 1
                  max: 2
                  chance: 0.5
                loot_3:
                  item: customcrops:golden_tomato
                  min: 1
                  max: 2
                  chance: 0.3
        interact-with-item:
          interact_1:
            item: GOLDEN_HOE
            reduce-amount: false
            actions:
              action_1:
                type: break
              action_2:
                type: replant
                value:
                  point: 0
                  crop: tomato
                  model: customcrops:tomato_stage_1

  # Custom grow conditions
  # You can get a full list of grow conditions on wiki page.
  # The default config tells that the crop would only grow in Spring and Autumn,
  # and it requires at least a certain amount of water to grow.
  # Though it would not grow in Summer, but it would still be alive. If you want
  # the crop to die, see the "death-conditions" below.
  # 自定义生长条件,默认配置是:农作物会在春和秋两个季节生长,并且要求种植盆水量大于3
  grow-conditions:
    condition_1:
      type: suitable_season
      value:
        - Spring
        - Autumn
    condition_2:
      type: water_more_than
      value: 2

  # Custom death conditions
  # 自定义死亡条件
  death-conditions:
    no_water:
      # You can customize the dead models according to the reasons
      # 你可以根据死因设置不同的死亡模型
      model: customcrops:crop_stage_death
      conditions:
        # "&&" represents "And"
        # "||" represents "Or"
        # the default config tells that the crop would have 70% chance to die if the pot is dry
        # 默认配置:农作物有70%概率在种植盆干燥情况下死亡
        '&&':
          condition_1:
            type: water_less_than
            value: 1
          condition_2:
            type: random
            value: 0.7
    unsuitable_season:
      model: customcrops:crop_stage_death
      conditions:
        condition_1:
          type: unsuitable_season
          value:
            - Winter
    crow_attack:
      # Crop would be removed if "model" is not set
      # 如果没有设置model,农作物会直接被移除,而不是替换模型
      conditions:
        condition_1:
          type: crow_attack
          value:
            chance: 0.001
            fly-model: customcrops:crow_fly
            stand-model: customcrops:crow_stand

  # Custom bone meal
  # 自定义骨粉
  custom-bone-meal:
    bone_meal_1:
      item: BONE_MEAL
      particle: VILLAGER_HAPPY
      sound: minecraft:item.bone_meal.use
      # 20% chance to grow 2 points
      # (100% - 20%) * 60% = 48% chance to grow 1 point
      # 20%概率获得两个生长点数
      # (100% - 20%) * 60% = 48% 概率获得一个生长点数
      chance:
        2: 0.2
        1: 0.6
    bone_meal_2:
      item: customcrops:custom_bone_meal
      return: customcrops:custom_bone_meal_used
      chance:
        2: 0.4
        1: 1

Last updated