RPGClasses

RPGClasses 1.0.2-MINI

Slavko submitted a new resource:

RPGClasses - An advanced RPG class plugin for Nukkit featuring 6 unique classes, level progression...

RPG Classes Plugin for Nukkit
A comprehensive role-playing system that enhances gameplay with 6 unique character classes, progression mechanics, and special abilities. Key features include:
  1. Class System:
    • 6 distinct classes (Warrior, Archer, Mage, Rogue, Tank, Healer)
    • Unique abilities for each class
    • Visual class selection interface
  2. Progression Mechanics:
    • XP gain from mob kills
    • Level-up system with configurable...
Read more about this resource...
 

Rakilem

Member
Привет! Я тестирую этот плагин, и у меня возникли проблемы: не создаётся файл языков, и команда /class вообще не работает. rpg.png
 

indra87g

New Member
I found another error. It's when loading classes.yml

But after I changed classes.yml to this, everything was resolved:
YAML:
# RPG Classes Configuration

# ------------------------

# Format:

# class_id:

#   name: Display name (supports color codes)

#   description: Class description

#   damage-multiplier: Damage modifier (1.0 = normal)

#   regeneration-rate: HP regenerated per second

#   abilities:

#     "level_number": "Ability description (unlocks at this level)"

classes:

  warrior:

    name: "&4Warrior"

    description: "Strong melee fighter with high damage"

    damage-multiplier: 1.2  # 20% more damage

    regeneration-rate: 0.5   # 0.5 HP per second

    abilities:

      "5": "&aPower Strike (+20% damage)"

      "10": "&aWhirlwind Attack (AOE damage)"

      "20": "&cBerserker Rage (50% more damage when low HP)"

  archer:

    name: "&2Archer"

    description: "Ranged damage dealer with quick attacks"

    damage-multiplier: 1.1  # 10% more damage

    regeneration-rate: 0.3   # 0.3 HP per second

    abilities:

      "5": "&aPrecision Shot (ignore armor)"

      "10": "&aMulti Shot (shoot 3 arrows)"

      "20": "&cPiercing Arrow (penetrates enemies)"

  mage:

    name: "&9Mage"

    description: "Powerful spell caster with magic attacks"

    damage-multiplier: 1.3  # 30% more damage

    regeneration-rate: 0.2   # 0.2 HP per second

    abilities:

      "5": "&aFireball (explodes on impact)"

      "10": "&aIce Nova (slows enemies)"

      "20": "&cMeteor Shower (massive AOE damage)"

  rogue:

    name: "&8Rogue"

    description: "Stealthy assassin with critical hits"

    damage-multiplier: 1.25  # 25% more damage

    regeneration-rate: 0.4    # 0.4 HP per second

    abilities:

      "5": "&aBackstab (triple damage from behind)"

      "10": "&aShadow Step (short teleport)"

      "20": "&cDeath Mark (execute low HP enemies)"

  tank:

    name: "&6Tank"

    description: "Defensive specialist with high HP"

    damage-multiplier: 0.9  # 10% less damage

    regeneration-rate: 1.0   # 1.0 HP per second

    abilities:

      "5": "&aIron Skin (reduce damage)"

      "10": "&aTaunt (force enemies to attack you)"

      "20": "&cLast Stand (survive lethal damage once)"

  healer:

    name: "&dHealer"

    description: "Support class that heals allies"

    damage-multiplier: 0.8  # 20% less damage

    regeneration-rate: 0.7   # 0.7 HP per second

    abilities:

      "5": "&aHealing Aura (heal nearby allies)"

      "10": "&aRevive (bring dead allies back)"

      "20": "&cDivine Protection (prevent all damage for 5s)"
 

indra87g

New Member
Could I use your classes.yml in new version? And I have question: if you solve this error everything probably working?
I tried it myself earlier, and it worked. There were no errors.

Before I tried it, this is the error that occurred:
09:05:09 [ERROR] Throwing

java.lang.RuntimeException: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
at cn.nukkit.plugin.PluginManager.enablePlugin(PluginManager.java:436) [server.jar:?]
at cn.nukkit.Server.enablePlugin(Server.java:749) [server.jar:?]
at cn.nukkit.Server.enablePlugins(Server.java:734) [server.jar:?]
at cn.nukkit.Server.<init>(Server.java:623) [server.jar:?]
at cn.nukkit.Nukkit.main(Nukkit.java:113) [server.jar:?]
Caused by: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:986) ~[?:?]
at cn.nukkit.utils.ConfigSection.getKeys(ConfigSection.java:716) ~[server.jar:?]
at cn.nukkit.utils.ConfigSection.lambda$getKeys$2(ConfigSection.java:720) ~[server.jar:?]
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:986) ~[?:?]
at cn.nukkit.utils.ConfigSection.getKeys(ConfigSection.java:716) ~[server.jar:?]
at cn.nukkit.utils.ConfigSection.lambda$getKeys$2(ConfigSection.java:720) ~[server.jar:?]
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:986) ~[?:?]
at cn.nukkit.utils.ConfigSection.getKeys(ConfigSection.java:716) ~[server.jar:?]
at cn.nukkit.utils.ConfigSection.lambda$getKeys$2(ConfigSection.java:720) ~[server.jar:?]
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:986) ~[?:?]
at cn.nukkit.utils.ConfigSection.getKeys(ConfigSection.java:716) ~[server.jar:?]
at cn.nukkit.utils.ConfigSection.exists(ConfigSection.java:671) ~[server.jar:?]
at cn.nukkit.utils.ConfigSection.exists(ConfigSection.java:688) ~[server.jar:?]
at cn.nukkit.utils.Config.exists(Config.java:501) ~[server.jar:?]
at frost.rpg.RPGClasses.initConfigs(RPGClasses.java:63) ~[?:?]
at frost.rpg.RPGClasses.onEnable(RPGClasses.java:37) ~[?:?]
at cn.nukkit.plugin.PluginBase.setEnabled(PluginBase.java:91) ~[server.jar:?]
at cn.nukkit.plugin.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:118) ~[server.jar:?]
at cn.nukkit.plugin.PluginManager.enablePlugin(PluginManager.java:432) ~[server.jar:?]
... 4 more
I asked the DeepSeek AI and this is the answer:
Pay attention to the abilities section. The key of abilities is a number (5, 10, 20), which in YAML will be parsed as an Integer, not a String.


When Nukkit's Config system tries to read all keys from the config (in the getKeys() method called by exists()), it finds that there are Integer keys in the structure, but the system may expect all keys to be Strings. This causes a failure when trying to cast Integer to String.

How to fix it:
You need to change the keys in the abilities section from numbers to strings. Add quotation marks around the numbers.
 
Top