boolean success = true;
for (PotionEffect effect : effects) {
if (effect == null) {
continue;
}
CompoundTag potion_effect = TAG.copy();
potion_effect.setName("");
potion_effect.put("Id", (byte) effect.getPotionID());
potion_effect.put("Duration", effect.getDuration());
potion_effect.put("Amplifier", (byte) effect.getAmplifier());
potion_effect.put("Ambient", effect.isAmbient());
success &= potion_effects.add(potion_effect);
}
return success;
}