Interface HornHarvestable

All Known Implementing Classes:
DefaultHornHarvestable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface HornHarvestable
Blocks with this capability can express custom logic when being harvested by Botania horns.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHornHarvest(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, HornHarvestable.EnumHornType hornType, @Nullable net.minecraft.world.entity.LivingEntity user)
    Returns true if this block can be uprooted.
    default void
    harvestByHorn(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, HornHarvestable.EnumHornType hornType, @Nullable net.minecraft.world.entity.LivingEntity user)
    Called to harvest by a horn.
    default boolean
    hasSpecialHornHarvest(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, HornHarvestable.EnumHornType hornType, @Nullable net.minecraft.world.entity.LivingEntity user)
    Returns true if harvestByHorn() should be called.
  • Field Details

    • ID

      static final net.minecraft.resources.ResourceLocation ID
  • Method Details

    • canHornHarvest

      boolean canHornHarvest(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, HornHarvestable.EnumHornType hornType, @Nullable @Nullable net.minecraft.world.entity.LivingEntity user)
      Returns true if this block can be uprooted. Note that the stack param can be empty if it's a drum breaking it.
    • hasSpecialHornHarvest

      default boolean hasSpecialHornHarvest(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, HornHarvestable.EnumHornType hornType, @Nullable @Nullable net.minecraft.world.entity.LivingEntity user)
      Returns true if harvestByHorn() should be called. If false it just uses the normal block breaking method. Note that the stack param can be empty if it's a drum breaking it.
    • harvestByHorn

      default void harvestByHorn(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack, HornHarvestable.EnumHornType hornType, @Nullable @Nullable net.minecraft.world.entity.LivingEntity user)
      Called to harvest by a horn. Note that the stack param can be empty if it's a drum breaking it.