class EnchantmentType implements WordType<Enchantment> {

    @Override
    public Enchantment parse(StringReader reader) throws CommandSyntaxException {
        var name = reader.readUnquotedString().toLowerCase();
        var enchantment = ENCHANTMENTS.get(name);
        
        if (enchantment == null) {
            throw EXCEPTION.createWithContext(reader, name);
        }
        
        return enchantment;
    }

}