Add leash API. Adds BUKKIT-4459 and BUKKIT-4583
By: T00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user