diff --git a/paper-api/src/main/java/org/bukkit/entity/EntityCategory.java b/paper-api/src/main/java/org/bukkit/entity/EntityCategory.java new file mode 100644 index 0000000000..fd960f20c7 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/entity/EntityCategory.java @@ -0,0 +1,63 @@ +package org.bukkit.entity; + +import org.bukkit.enchantments.Enchantment; +import org.bukkit.potion.PotionEffectType; + +/** + * A classification of entities which may behave differently than others or be + * affected uniquely by enchantments and potion effects among other things. + */ +public enum EntityCategory { + + /** + * Any uncategorized entity. No additional effects are applied to these + * entities relating to a categorization. + */ + NONE, + /** + * Undead creatures. These creatures: + * + */ + UNDEAD, + /** + * Entities of the arthropod family. These creatures: + * + */ + ARTHROPOD, + /** + * Entities that participate in raids. These creatures: + * + */ + ILLAGER, + /** + * Entities that reside primarily underwater (excluding {@link Drowned}). + * These creatures: + * + */ + WATER; +} diff --git a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java index 8744f2e5fd..dd6eff5cc5 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -552,4 +552,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @param the type of the passed value */ void setMemory(@NotNull MemoryKey memoryKey, @Nullable T memoryValue); + + /** + * Get the category to which this entity belongs. + * + * Categories may subject this entity to additional effects, benefits or + * debuffs. + * + * @return the entity category + */ + @NotNull + public EntityCategory getCategory(); }