Interface GrowthType

All Known Subinterfaces:
BonemealableGrowthType, ReplantableGrowthType

public interface GrowthType
Holds a Plant's growth logic.
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<GrowthType> CODEC
  • Method Details

    • codec

      com.mojang.serialization.MapCodec<? extends GrowthType> codec()
      Returns:
      The registered MapCodec.
    • canGrow

      boolean canGrow(GrowthContext context)
      Parameters:
      context - The GrowthContext to use.
      Returns:
      Whether the plant can currently be grown or not.
    • grow

      void grow(GrowthContext context)
      Grows the plant, if possible.
      Parameters:
      context - The GrowthContext to use.
    • canHarvest

      boolean canHarvest(GrowthContext context)
      Parameters:
      context - The GrowthContext to use.
      Returns:
      Whether the plant can currently be harvested or not.
    • harvest

      List<net.minecraft.world.item.ItemStack> harvest(GrowthContext context, boolean replant)
      Harvests the plant, if possible.
      Parameters:
      context - The GrowthContext to use.
      replant - Whether the plant should be replanted or not, if possible.
      Returns:
      A list of ItemStack, representing the drops of the plant.