diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 700c0072da..8477337b09 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -436,8 +436,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return entity; } + @Override public void playEffect(EntityEffect type) { - this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData()); + Preconditions.checkArgument(type != null, "type"); + + if (this.getClass().isAssignableFrom(type.getApplicable())) { + this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData()); + } } public void setHandle(final Entity entity) {