ServerEvents.recipes(event => {
    let rare_candy = 'rare_candy'
    let xs_candy = 'exp_candy_xs'
    let s_candy = 'exp_candy_s'
    let m_candy = 'exp_candy_m'
    let l_candy = 'exp_candy_l'
    let xl_candy = 'exp_candy_xl'

    let MOD = (domain, id, x) => (x ? `${x}x ` : "") + (id.startsWith('#') ? '#' : "") + domain + ":" + id.replace('#', '')
    let CM = (id, x) => MOD("cobblemon", id, x)

    event.shapeless(CM(xs_candy), ['2x minecraft:glowstone_dust', 'minecraft:emerald'])
    event.shapeless(CM(s_candy), ['6x ' + CM(xs_candy)])
    event.shapeless(CM(m_candy), ['3x ' + CM(s_candy)])
    event.shapeless(CM(l_candy), ['3x ' + CM(m_candy)])
    event.shapeless(CM(xl_candy), ['2x ' + CM(l_candy)])
    event.shapeless(CM('rare_candy'), ['3x ' + CM(l_candy), 'minecraft:diamond'])
})
