Interface IFarmerBehavior
public interface IFarmerBehavior
-
Method Summary
Modifier and TypeMethodDescriptiondefault Integerintstatic voidtryHarvestPlant(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos, IFarmer farmer) Try to harvest a plant with this behaviortryPlantSeed(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 plantworld- The worldpos- The position to plant the seed onfarmer- 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 worldpos- The position of the plantfarmer- 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
-
initBehaviors
static void initBehaviors()
-