Interface Shearable

All Superinterfaces:
Audience, CommandSender, Entity, HoverEventSource<HoverEvent.ShowEntity>, Metadatable, Nameable, Permissible, PersistentDataHolder, Pointered, ServerOperator, Sound.Emitter
All Known Subinterfaces:
Bogged, MushroomCow, Sheep, Snowman

public interface Shearable extends Entity
Represents an entity that can be sheared.
  • Method Details

    • shear

      default void shear()
      Forces the entity to be sheared and then play the effect as if it were sheared by a player. This will cause the entity to be sheared, even if readyToBeSheared() is false.

      Some shearing behavior may cause the entity to no longer be valid due to it being replaced by a different entity.

    • shear

      void shear(@NotNull Sound.Source source)
      Forces the entity to be sheared and then play the effect as if it were sheared by the provided source. This will cause the entity to be sheared, even if readyToBeSheared() is false.

      Some shearing behavior may cause the entity to no longer be valid due to it being replaced by a different entity.

      This simulates the behavior of an actual shearing, which may cause events like EntityTransformEvent to be called for mooshrooms, and EntityDropItemEvent to be called for sheep.

      Parameters:
      source - Sound source to play any sound effects on
    • readyToBeSheared

      boolean readyToBeSheared()
      Gets if the entity would be able to be sheared or not naturally using shears.
      Returns:
      if the entity can be sheared