From 3aed26f6b2a4b4f5b09486c8cc4791fa9ed6b133 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 25 Mar 2016 00:33:15 +0100 Subject: [PATCH] Implement getting / setting of Entity invulnerability. By: Sansko1337 --- .../src/main/java/org/bukkit/entity/Entity.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/Entity.java b/paper-api/src/main/java/org/bukkit/entity/Entity.java index 6dc7076819..bba33b95fd 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Entity.java +++ b/paper-api/src/main/java/org/bukkit/entity/Entity.java @@ -356,4 +356,21 @@ public interface Entity extends Metadatable, CommandSender { * @return whether the entity is glowing */ boolean isGlowing(); + + /** + * Sets whether the entity is invulnerable or not. + *

+ * When an entity is invulnerable it can only be damaged by players in + * creative mode. + * + * @param flag if the entity is invulnerable + */ + public void setInvulnerable(boolean flag); + + /** + * Gets whether the entity is invulnerable or not. + * + * @return whether the entity is + */ + public boolean isInvulnerable(); }