Interface IButterflySpeciesType

All Superinterfaces:
IBreedingTrackerHandler, ISpeciesType<IButterflySpecies,IButterfly>

public interface IButterflySpeciesType extends ISpeciesType<IButterflySpecies,IButterfly>
  • Method Details

    • getBreedingTracker

      IBreedingTracker getBreedingTracker(net.minecraft.world.level.LevelAccessor level, @Nullable com.mojang.authlib.GameProfile profile)
      Description copied from interface: ISpeciesType
      Gets the player's breeding tracker for this species type.
      Specified by:
      getBreedingTracker in interface ISpeciesType<IButterflySpecies,IButterfly>
      Parameters:
      level - The world instance where the breeding tracker is stored.
      profile - The player whose breeding tracker should be returned.
      Returns:
      The breeding tracker for species of this type.
    • getCocoon

      IButterflyCocoon getCocoon(net.minecraft.resources.ResourceLocation id)
      Returns:
      The cocoon registered with the given ID, throwing if none is registered. For internal/fail-fast callers only; the cocoon reference chromosome itself resolves through getCocoonSafe(net.minecraft.resources.ResourceLocation) so a datapack-authored species referencing an unregistered cocoon id can't crash saved/rendered butterflies.
    • getCocoonSafe

      @Nullable IButterflyCocoon getCocoonSafe(net.minecraft.resources.ResourceLocation id)
      Returns:
      The cocoon registered with the given ID, or null if none is registered (graceful fallback variant; backs the cocoon reference chromosome).
    • getButterflyEffect

      IButterflyEffect getButterflyEffect(net.minecraft.resources.ResourceLocation id)
      Returns:
      The butterfly effect registered with the given ID, throwing if none is registered. For internal/fail-fast callers only; the butterfly_effect reference chromosome itself resolves through getButterflyEffectSafe(net.minecraft.resources.ResourceLocation) so a datapack-authored species referencing an unregistered effect id can't crash saved/rendered butterflies.
    • getButterflyEffectSafe

      @Nullable IButterflyEffect getButterflyEffectSafe(net.minecraft.resources.ResourceLocation id)
      Returns:
      The butterfly effect registered with the given ID, or null if none is registered (graceful fallback variant; backs the butterfly_effect reference chromosome).
    • spawnButterflyInWorld

      net.minecraft.world.entity.Mob spawnButterflyInWorld(net.minecraft.world.level.Level level, IButterfly butterfly, double x, double y, double z)
      Spawns the given butterfly in the world.
      Returns:
      butterfly entity on success, null otherwise.
    • plantCocoon

      @Nullable net.minecraft.core.BlockPos plantCocoon(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, IButterfly caterpillar, int age, boolean createNursery)
    • isMated

      boolean isMated(net.minecraft.world.item.ItemStack stack)
      Returns:
      true if passed item is mated.
    • createSpeciesProvider

      net.minecraft.data.DataProvider createSpeciesProvider(net.minecraft.data.PackOutput output, CompletableFuture<net.minecraft.core.HolderLookup.Provider> registries, Consumer<ILepidopterologyRegistration> species)
      Creates a data provider that generates butterfly species JSON.
      Parameters:
      output - The pack output to generate into
      registries - The registries used to encode the species
      species - The action that registers the species to generate
      Returns:
      The data provider to add to the data generator