Interface IButterfly

All Superinterfaces:
IIndividual, IIndividualLiving

public interface IButterfly extends IIndividualLiving
  • Method Details

    • canSpawn

      boolean canSpawn(net.minecraft.world.level.Level level, double x, double y, double z)
      Returns:
      true if the butterfly can naturally spawn at the given location at this time. (Used to auto-spawn butterflies from tree leaves.)
    • canTakeFlight

      boolean canTakeFlight(net.minecraft.world.level.Level level, double x, double y, double z)
      Returns:
      true if the butterfly can take flight at the given location at this time. (Used to auto-spawn butterflies from dropped items.)
    • isAcceptedEnvironment

      default boolean isAcceptedEnvironment(net.minecraft.world.level.Level level, double x, double y, double z)
    • isAcceptedEnvironment

      boolean isAcceptedEnvironment(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
    • spawnCaterpillar

      @Nullable IButterfly spawnCaterpillar(IButterflyNursery nursery)
      Returns:
      create a caterpillar with the two genome's from the nursery.
    • getLootDrop

      List<net.minecraft.world.item.ItemStack> getLootDrop(IEntityButterfly entity, boolean playerKill, int lootLevel)
      Parameters:
      playerKill - Whether or not the butterfly was killed by a player.
      lootLevel - Loot level according to the weapon used to kill the butterfly.
      Returns:
      Items to drop on death of the given entity.
    • getCaterpillarDrop

      List<net.minecraft.world.item.ItemStack> getCaterpillarDrop(IButterflyNursery nursery, boolean playerKill, int lootLevel)
      Parameters:
      playerKill - Whether or not the nursery was broken by a player.
      lootLevel - Fortune level.
      Returns:
      Items to drop on breaking of the nursery.
    • getCocoonDrop

      List<net.minecraft.world.item.ItemStack> getCocoonDrop(boolean includeButterfly, IButterflyCocoon cocoon)
      Parameters:
      includeButterfly - Whether the butterfly should drop from the cocoon. Used by worldgen cocoons.
      Returns:
      Items to drop on breaking of the cocoon.
    • copy

      IButterfly copy()
      Description copied from interface: IIndividual
      Copies this individual and all of its properties EXCEPT FOR ITS MATE. Override this method in subclasses to make sure all information is copied.
      Specified by:
      copy in interface IIndividual
      Specified by:
      copy in interface IIndividualLiving
      Returns:
      An exact copy of this individual with NO MATE and NOT ANALYZED.
    • getType

      Specified by:
      getType in interface IIndividual
      Returns:
      The species type of this individual.
    • getSpecies

      IButterflySpecies getSpecies()
      Specified by:
      getSpecies in interface IIndividual
      Returns:
      The active species of this individual. Prefer this method over getting it from IIndividual.getGenome().
    • getInactiveSpecies

      IButterflySpecies getInactiveSpecies()
      Specified by:
      getInactiveSpecies in interface IIndividual
      Returns:
      The inactive species of the individual. Prefer this method over getting it from IIndividual.getGenome().
    • getDisplayName

      net.minecraft.network.chat.Component getDisplayName()