Interface Horse

All Superinterfaces:
Ageable, Animals, CommandSender, Creature, Damageable, Entity, InventoryHolder, LivingEntity, Metadatable, Permissible, ProjectileSource, ServerOperator, Tameable, Vehicle

public interface Horse
extends Animals, Vehicle, InventoryHolder, Tameable
Represents a Horse.
  • Method Details

    • getVariant

      Horse.Variant getVariant()
      Gets the horse's variant.

      A horse's variant defines its physical appearance and capabilities. Whether a horse is a regular horse, donkey, mule, or other kind of horse is determined using the variant.

      Returns:
      a Horse.Variant representing the horse's variant
    • setVariant

      void setVariant​(Horse.Variant variant)
      Sets the horse's variant.

      A horse's variant defines its physical appearance and capabilities. Whether a horse is a regular horse, donkey, mule, or other kind of horse can be set using the variant.

      Setting a horse's variant does not change its attributes such as its owner and its tamed status, but changing a mule or donkey with a chest to another variant which does not support a chest will remove the chest and its contents.

      Parameters:
      variant - a Horse.Variant for this horse
    • getColor

      Horse.Color getColor()
      Gets the horse's color.

      Colors only apply to horses, not to donkeys, mules, skeleton horses or undead horses.

      Returns:
      a Horse.Color representing the horse's group
    • setColor

      void setColor​(Horse.Color color)
      Sets the horse's color.

      Attempting to set a color for any donkey, mule, skeleton horse or undead horse will not result in a change.

      Parameters:
      color - a Horse.Color for this horse
    • getStyle

      Horse.Style getStyle()
      Gets the horse's style. Styles determine what kind of markings or patterns a horse has.

      Styles only apply to horses, not to donkeys, mules, skeleton horses or undead horses.

      Returns:
      a Horse.Style representing the horse's style
    • setStyle

      void setStyle​(Horse.Style style)
      Sets the style of this horse. Styles determine what kind of markings or patterns a horse has.

      Attempting to set a style for any donkey, mule, skeleton horse or undead horse will not result in a change.

      Parameters:
      style - a Horse.Style for this horse
    • isCarryingChest

      boolean isCarryingChest()
      Gets whether the horse has a chest equipped.
      Returns:
      true if the horse has chest storage
    • setCarryingChest

      void setCarryingChest​(boolean chest)
      Sets whether the horse has a chest equipped. Removing a chest will also clear the chest's inventory.
      Parameters:
      chest - true if the horse should have a chest
    • getDomestication

      int getDomestication()
      Gets the domestication level of this horse.

      A higher domestication level indicates that the horse is closer to becoming tame. As the domestication level gets closer to the max domestication level, the chance of the horse becoming tame increases.

      Returns:
      domestication level
    • setDomestication

      void setDomestication​(int level)
      Sets the domestication level of this horse.

      Setting the domestication level to a high value will increase the horse's chances of becoming tame.

      Domestication level must be greater than zero and no greater than the max domestication level of the horse, determined with getMaxDomestication()

      Parameters:
      level - domestication level
    • getMaxDomestication

      int getMaxDomestication()
      Gets the maximum domestication level of this horse.

      The higher this level is, the longer it will likely take for the horse to be tamed.

      Returns:
      the max domestication level
    • setMaxDomestication

      void setMaxDomestication​(int level)
      Sets the maximum domestication level of this horse.

      Setting a higher max domestication will increase the amount of domesticating (feeding, riding, etc.) necessary in order to tame it, while setting a lower max value will have the opposite effect.

      Maximum domestication must be greater than zero.

      Parameters:
      level - the max domestication level
    • getJumpStrength

      double getJumpStrength()
      Gets the jump strength of this horse.

      Jump strength defines how high the horse can jump. A higher jump strength increases how high a jump will go.

      Returns:
      the horse's jump strength
    • setJumpStrength

      void setJumpStrength​(double strength)
      Sets the jump strength of this horse.

      A higher jump strength increases how high a jump will go. Setting a jump strength to 0 will result in no jump. You cannot set a jump strength to a value below 0 or above 2.

      Parameters:
      strength - jump strength for this horse
    • getInventory

      HorseInventory getInventory()
      Description copied from interface: InventoryHolder
      Get the object's inventory.
      Specified by:
      getInventory in interface InventoryHolder
      Returns:
      The inventory.