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
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classHorse.ColorRepresents the base color that the horse has.static classHorse.StyleRepresents the style, or markings, that the horse has.static classHorse.VariantRepresents the different types of horses that may exist. -
Method Summary
Modifier and Type Method Description Horse.ColorgetColor()Gets the horse's color.intgetDomestication()Gets the domestication level of this horse.HorseInventorygetInventory()Get the object's inventory.doublegetJumpStrength()Gets the jump strength of this horse.intgetMaxDomestication()Gets the maximum domestication level of this horse.Horse.StylegetStyle()Gets the horse's style.Horse.VariantgetVariant()Gets the horse's variant.booleanisCarryingChest()Gets whether the horse has a chest equipped.voidsetCarryingChest(boolean chest)Sets whether the horse has a chest equipped.voidsetColor(Horse.Color color)Sets the horse's color.voidsetDomestication(int level)Sets the domestication level of this horse.voidsetJumpStrength(double strength)Sets the jump strength of this horse.voidsetMaxDomestication(int level)Sets the maximum domestication level of this horse.voidsetStyle(Horse.Style style)Sets the style of this horse.voidsetVariant(Horse.Variant variant)Sets the horse's variant.Methods inherited from interface org.bukkit.entity.Ageable
canBreed, getAge, getAgeLock, isAdult, setAdult, setAge, setAgeLock, setBaby, setBreedMethods inherited from interface org.bukkit.entity.Damageable
_INVALID_damage, _INVALID_damage, _INVALID_getHealth, _INVALID_getMaxHealth, _INVALID_setHealth, _INVALID_setMaxHealth, damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealthMethods inherited from interface org.bukkit.entity.Entity
eject, getCustomName, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getServer, getTicksLived, getType, getUniqueId, getVehicle, getWorld, isCustomNameVisible, isDead, isEmpty, isInsideVehicle, isOnGround, isValid, leaveVehicle, playEffect, remove, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setLastDamageCause, setPassenger, setTicksLived, spigot, teleport, teleport, teleport, teleportMethods inherited from interface org.bukkit.entity.LivingEntity
_INVALID_getLastDamage, _INVALID_setLastDamage, addPotionEffect, addPotionEffect, addPotionEffects, getActivePotionEffects, getCanPickupItems, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getKiller, getLastDamage, getLastTwoTargetBlocks, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getNoDamageTicks, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlock, hasLineOfSight, hasPotionEffect, isLeashed, removePotionEffect, setCanPickupItems, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, shootArrow, throwEgg, throwSnowballMethods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.projectiles.ProjectileSource
launchProjectile, launchProjectile
-
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.Variantrepresenting the horse's variant
-
setVariant
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- aHorse.Variantfor 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.Colorrepresenting the horse's group
-
setColor
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- aHorse.Colorfor 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.Stylerepresenting the horse's style
-
setStyle
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- aHorse.Stylefor 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:InventoryHolderGet the object's inventory.- Specified by:
getInventoryin interfaceInventoryHolder- Returns:
- The inventory.
-