
function manaStringFull(item) {
    let spell = lib.getSpellFromItem(item.typeId);
    let spell_instance = this.tickingSpells.get(spell);
    let mana = mc.world.scoreboard.getObjective("cyd_mgspl_mana").getScore(this.player);

    let actionbar_cooldown = { "text": "" };
    let actionbar_charge = { "text": "" };
    const actionbar_mana = { "rawtext": [{ translate: "cyd_mgspl.feedback_mana" }, { "text": ": " + mana + " /" + this.manaMax }] };

    if (spell_instance != undefined) {
      actionbar_cooldown = { "rawtext": [{ "text": "§f | " }, { translate: "cyd_mgspl.feedback_cooldown" }, { "text": ": " + coolDownInSeconds(spell_instance.cooldown) }] };
      if (spell_instance.charge != undefined) actionbar_charge = { "rawtext": [{ "text": "§f | " }, { translate: "cyd_mgspl.feedback_charge" }, { "text": ": " + spell_instance.charge + "/" + spell_instance.chargeMax }] };
    };

    this.player.onScreenDisplay.setActionBar({ "rawtext": [actionbar_mana, actionbar_cooldown, actionbar_charge] });
  }

  function manaStringCompact(item) {
    let spell = lib.getSpellFromItem(item.typeId);
    let spell_instance = this.tickingSpells.get(spell);
    let mana = mc.world.scoreboard.getObjective("cyd_mgspl_mana").getScore(this.player);
    let actionbar_message = "§b" + mana + "/" + this.manaMax;

    if (spell_instance != undefined) {
      actionbar_message = actionbar_message + "§f | §c" + coolDownInSeconds(spell_instance.cooldown);
      if (spell_instance.charge != undefined) actionbar_message = actionbar_message + "§f | §a" + spell_instance.charge + "/" + spell_instance.chargeMax;
    }
    this.player.onScreenDisplay.setActionBar(actionbar_message);
  }

  function coolDownInSeconds(cooldown) {
    return (Math.round((0.05 * cooldown) * 100) / 100).toFixed(2);
  }