Interface IFarmerBehavior


public interface IFarmerBehavior
  • Method Summary

    Modifier and Type
    Method
    Description
    default Integer
     
    int
     
    static void
     
    tryHarvestPlant(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos, IFarmer farmer)
    Try to harvest a plant with this behavior
    tryPlantSeed(net.minecraft.world.item.ItemStack seed, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, IFarmer farmer)
    Try to plant a seed with this behavior If this method returns true, the seed ItemStack will be shrunk by one.
  • Method Details

    • tryPlantSeed

      FarmerResult tryPlantSeed(net.minecraft.world.item.ItemStack seed, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, IFarmer farmer)
      Try to plant a seed with this behavior If this method returns true, the seed ItemStack will be shrunk by one. This method will not be called if the block at the given position is not replaceable.
      Parameters:
      seed - The seed stack to plant
      world - The world
      pos - The position to plant the seed on
      farmer - The Farmer doing this action. Can be used to query and extract energy and add items to the slots
      Returns:
      If planting was successful
    • tryHarvestPlant

      FarmerResult tryHarvestPlant(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos, IFarmer farmer)
      Try to harvest a plant with this behavior
      Parameters:
      world - The world
      pos - The position of the plant
      farmer - The Farmer doing this action. Can be used to query and extract energy and add items to the slots
      Returns:
      If harvesting was successful
    • getPriority

      int getPriority()
    • getPrioInt

      default Integer getPrioInt()
    • initBehaviors

      static void initBehaviors()