Interface MushroomCow

All Superinterfaces:
Ageable, Animals, Attributable, Audience, Breedable, CommandSender, Cow, Creature, Damageable, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, Leashable, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ProjectileSource, ServerOperator, Shearable, Sound.Emitter

public interface MushroomCow extends Cow, Shearable
Represents a mushroom Cow
  • Method Details

    • hasEffectsForNextStew

      boolean hasEffectsForNextStew()
      Checks for the presence of custom potion effects to be applied to the next suspicious stew received from milking this MushroomCow.
      Returns:
      true if custom potion effects are applied to the stew
    • getEffectsForNextStew

      @NotNull @NotNull List<PotionEffect> getEffectsForNextStew()
      Gets an immutable list containing all custom potion effects applied to the next suspicious stew received from milking this MushroomCow.

      Plugins should check that hasCustomEffects() returns true before calling this method.

      Returns:
      an immutable list of custom potion effects
    • addEffectToNextStew

      @Deprecated(forRemoval=true, since="1.20.2") boolean addEffectToNextStew(@NotNull @NotNull PotionEffect effect, boolean overwrite)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use addEffectToNextStew(io.papermc.paper.potion.SuspiciousEffectEntry, boolean) as PotionEffect suggests that all attributes are used. In fact, only the PotionEffectType and the duration are used.
      Adds a custom potion effect to be applied to the next suspicious stew received from milking this MushroomCow.
      Parameters:
      effect - the potion effect to add
      overwrite - true if any existing effect of the same type should be overwritten
      Returns:
      true if the effects to be applied to the suspicious stew changed as a result of this call
    • addEffectToNextStew

      boolean addEffectToNextStew(@NotNull SuspiciousEffectEntry suspiciousEffectEntry, boolean overwrite)
      Adds a suspicious effect entry to be applied to the next suspicious stew received from milking this MushroomCow.
      Parameters:
      suspiciousEffectEntry - the suspicious effect entry to add
      overwrite - true if any existing effect of the same type should be overwritten
      Returns:
      true if the effects to be applied to the suspicious stew changed as a result of this call
    • removeEffectFromNextStew

      boolean removeEffectFromNextStew(@NotNull @NotNull PotionEffectType type)
      Removes a custom potion effect from being applied to the next suspicious stew received from milking this MushroomCow.
      Parameters:
      type - the potion effect type to remove
      Returns:
      true if the effects to be applied to the suspicious stew changed as a result of this call
    • hasEffectForNextStew

      boolean hasEffectForNextStew(@NotNull @NotNull PotionEffectType type)
      Checks for a specific custom potion effect type to be applied to the next suspicious stew received from milking this MushroomCow.
      Parameters:
      type - the potion effect type to check for
      Returns:
      true if the suspicious stew to be generated has this effect
    • clearEffectsForNextStew

      void clearEffectsForNextStew()
      Removes all custom potion effects to be applied to the next suspicious stew received from milking this MushroomCow.
    • getVariant

      Get the variant of this cow.
      Returns:
      cow variant
    • setVariant

      void setVariant(@NotNull @NotNull MushroomCow.Variant variant)
      Set the variant of this cow.
      Parameters:
      variant - cow variant
    • getStewEffectDuration

      @Deprecated(forRemoval=true, since="1.20.2") @Contract("-> fail") default int getStewEffectDuration()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Mushroom cows can now hold multiple effects, use getStewEffects()
      Gets how long the effect applied to stew from this mushroom cow is.
      Returns:
      duration of the effect (in ticks)
    • setStewEffectDuration

      @Deprecated(forRemoval=true, since="1.20.2") @Contract("_ -> fail") default void setStewEffectDuration(int duration)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Mushroom cows can now hold multiple effects, use setStewEffects(java.util.List)
      Sets how long the effect applied to stew from this mushroom cow is.
      Parameters:
      duration - duration of the effect (in ticks)
    • getStewEffectType

      @Deprecated(forRemoval=true, since="1.20.2") @Contract("-> fail") default PotionEffectType getStewEffectType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Mushroom cows can now hold multiple effects, use getStewEffects()
      Gets the type of effect applied to stew from this mushroom cow is.
      Returns:
      effect type, or null if an effect is currently not set
      Throws:
      UnsupportedOperationException
    • setStewEffect

      @Deprecated(forRemoval=true, since="1.20.2") @Contract("_ -> fail") default void setStewEffect(@Nullable PotionEffectType type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Mushroom cows can now hold multiple effects, use setStewEffects(java.util.List)
      Sets the type of effect applied to stew from this mushroom cow is.
      Parameters:
      type - new effect type or null if this cow does not give effects
      Throws:
      UnsupportedOperationException
    • getStewEffects

      Returns an immutable collection of the effects applied to stew items for this mushroom cow.
      Returns:
      immutable effect entry collection
    • setStewEffects

      void setStewEffects(@NotNull List<SuspiciousEffectEntry> effects)
      Sets effects applied to stew items for this mushroom cow.
      Parameters:
      effects - effect entry list