Interface Llama

All Superinterfaces:
AbstractHorse, Ageable, Animals, Attributable, Audience, Breedable, ChestedHorse, CommandSender, Creature, Damageable, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, InventoryHolder, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, Pointered, ProjectileSource, RangedEntity, ServerOperator, Sound.Emitter, Tameable, Vehicle
All Known Subinterfaces:
TraderLlama

public interface Llama extends ChestedHorse, RangedEntity
Represents a Llama.
  • Method Details

    • getColor

      Gets the llama's color.
      Returns:
      a Llama.Color representing the llama's color
    • setColor

      void setColor(@NotNull @NotNull Llama.Color color)
      Sets the llama's color.
      Parameters:
      color - a Llama.Color for this llama
    • getStrength

      int getStrength()
      Gets the llama's strength. A higher strength llama will have more inventory slots and be more threatening to entities.
      Returns:
      llama strength [1,5]
    • setStrength

      void setStrength(int strength)
      Sets the llama's strength. A higher strength llama will have more inventory slots and be more threatening to entities. Inventory slots are equal to strength * 3.
      Parameters:
      strength - llama strength [1,5]
    • getInventory

      Description copied from interface: InventoryHolder
      Get the object's inventory.
      Specified by:
      getInventory in interface AbstractHorse
      Specified by:
      getInventory in interface InventoryHolder
      Returns:
      The inventory.
    • inCaravan

      boolean inCaravan()
      Checks if this llama is in a caravan. This means that this llama is currently following another llama.
      Returns:
      is in caravan
    • joinCaravan

      void joinCaravan(@NotNull @NotNull Llama llama)
      Joins a caravan, with the provided llama being the leader of the caravan. This llama will then follow the provided llama.
      Parameters:
      llama - head of caravan to join
    • leaveCaravan

      void leaveCaravan()
      Leaves the current caravan that they are in.
    • getCaravanHead

      @Nullable @Nullable Llama getCaravanHead()
      Get the llama that this llama is following.

      Does not necessarily mean the leader of the entire caravan.

      Returns:
      the llama currently being followed
    • hasCaravanTail

      boolean hasCaravanTail()
      Checks if another llama is currently following behind this llama.
      Returns:
      true if being followed in the caravan
    • getCaravanTail

      @Nullable @Nullable Llama getCaravanTail()
      Gets the llama that is currently following behind this llama.
      Returns:
      the llama following this llama, or null if none is following them
    • shouldJoinCaravan

      boolean shouldJoinCaravan()
      Check if this Llama should attempt to join a caravan
      Returns:
      True if Llama is allowed to join a caravan
    • setShouldJoinCaravan

      void setShouldJoinCaravan(boolean shouldJoinCaravan)
      Set if this Llama should attempt to join a caravan
      Parameters:
      shouldJoinCaravan - True to allow joining a caravan