diff options
Diffstat (limited to 'src/main/java')
4 files changed, 25 insertions, 11 deletions
diff --git a/src/main/java/org/bukkit/Entity.java b/src/main/java/org/bukkit/Entity.java index 773354d0..cf9ace2a 100644 --- a/src/main/java/org/bukkit/Entity.java +++ b/src/main/java/org/bukkit/Entity.java @@ -32,4 +32,17 @@ public interface Entity { * @return Entity ID */ public int getEntityID(); + /** + * Gets the entitys health from 0-20, where 0 is dead and 20 is full + * + * @return Health represented from 0-20 + */ + public int getHealth(); + + /** + * Sets the entitys health from 0-20, where 0 is dead and 20 is full + * + * @param health New health represented from 0-20 + */ + public void setHealth(int health); } diff --git a/src/main/java/org/bukkit/event/entity/EntityDamagedByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamagedByBlockEvent.java index 28362c92..bce0417a 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamagedByBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamagedByBlockEvent.java @@ -15,7 +15,7 @@ public class EntityDamagedByBlockEvent extends EntityEvent implements Cancellabl private int damage; private boolean cancelled; - public EntityDamagedByBlockEvent(Block damager, LivingEntity damagee, int damage) + public EntityDamagedByBlockEvent(Block damager, Entity damagee, int damage) { super(Event.Type.ENTITY_DAMAGEDBY_BLOCK, damagee); this.damager = damager; diff --git a/src/main/java/org/bukkit/event/entity/EntityDamagedByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamagedByEntityEvent.java index b3cccd5b..35c797ce 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamagedByEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamagedByEntityEvent.java @@ -11,11 +11,11 @@ import org.bukkit.event.Event; */ public class EntityDamagedByEntityEvent extends EntityEvent implements Cancellable { - private LivingEntity damager; + private Entity damager; private int damage; private boolean cancelled; - public EntityDamagedByEntityEvent(LivingEntity damager, LivingEntity damagee, int damage) + public EntityDamagedByEntityEvent(Entity damager, Entity damagee, int damage) { super(Event.Type.ENTITY_DAMAGEDBY_ENTITY, damagee); this.damager = damager; @@ -49,9 +49,9 @@ public class EntityDamagedByEntityEvent extends EntityEvent implements Cancellab /** * Returns the entity that damaged the player. - * @return LivingEntity that damaged the player + * @return Entity that damaged the player */ - public LivingEntity getDamager() + public Entity getDamager() { return damager; } diff --git a/src/main/java/org/bukkit/event/entity/EntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityEvent.java index 9638d4a3..4d2f9906 100644 --- a/src/main/java/org/bukkit/event/entity/EntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityEvent.java @@ -1,25 +1,26 @@ package org.bukkit.event.entity; +import org.bukkit.Entity; import org.bukkit.LivingEntity; import org.bukkit.event.Event; /** - * Represents an LivingEntity-related event + * Represents an Entity-related event */ public class EntityEvent extends Event { - protected LivingEntity entity; + protected Entity entity; - public EntityEvent(final Event.Type type, final LivingEntity what) + public EntityEvent(final Event.Type type, final Entity what) { super(type); entity = what; } /** - * Returns the LivingEntity involved in this event - * @return LivingEntity who is involved in this event + * Returns the Entity involved in this event + * @return Entity who is involved in this event */ - public final LivingEntity getEntity() + public final Entity getEntity() { return entity; } |