Add leash API. Adds BUKKIT-4459 and BUKKIT-4583

This commit is contained in:
T00thpick1
2013-07-30 15:40:12 -04:00
committed by Wesley Wolfe
parent 02f2b5e290
commit bf832ee9d6
6 changed files with 194 additions and 0 deletions

View File

@@ -369,4 +369,31 @@ public interface LivingEntity extends Entity, Damageable {
* @return if the custom name is displayed
*/
public boolean isCustomNameVisible();
/**
* Returns whether the entity is currently leashed.
*
* @return whether the entity is leashed
*/
public boolean isLeashed();
/**
* Gets the entity that is currently leading this entity.
*
* @return the entity holding the leash
* @throws IllegalStateException if not currently leashed
*/
public Entity getLeashHolder() throws IllegalStateException;
/**
* Sets the leash on this entity to be held by the supplied entity.
* <p>
* This method has no effect on EnderDragons, Withers, Players, or Bats.
* Non-living entities excluding leashes will not persist as leash
* holders.
*
* @param holder the entity to leash this entity to
* @return whether the operation was successful
*/
public boolean setLeashHolder(Entity holder);
}