public static String getCustomNBT(LivingEntity entity, String key) {
if (entity == null) return null;
Entity bukkitEntity = entity;
net.minecraft.server.v1_7_R4.Entity nmsEntity = ((CraftEntity) bukkitEntity).getHandle();
NBTTagCompound tag = new NBTTagCompound();
// Writes the entity's NBT data to tag
nmsEntity.c(tag);
// Return contents of the tag
return tag.getString(key);
}