Globox1997 / LevelZ

https://modrinth.com/mod/levelz
https://www.curseforge.com/minecraft/mc-mods/levelz
GNU General Public License v3.0
51 stars 50 forks source link

LevelZ

LevelZ is a mod which adds skillables to the player which can get skilled to unlock blocks and strengthen passive skills.

Installation

LevelZ is a mod built for the Fabric Loader. It requires Fabric API, Cloth Config API and LibZ to be installed separately; all other dependencies are installed with the mod.

License

LevelZ is licensed under GPLv3.

Datapacks

Most of the mods default settings can get changed via datapacks, Player attribute affecting settings can get changed via the config file.
If you don't know how to create a datapack check out Data Pack Wiki website and try to create your first one for the vanilla game.
If you know how to create one, the folder path has to be data\levelz\FOLDER\YOURFILE.json
For the skills put the file in folder skill, for restrictions use restriction.
Caution! Make sure you name the files differently than the existing ones.

Since version 2.0.0, skills can be created and overwritten via datapack.

Skill

A skill requires:

{
  "health": {
    "replace": false,
    "id": 0,
    "key": "health",
    "level": 20,
    "attributes": [
      {
        "type": "generic.max_health",
        "base": 10,
        "operation": "ADD_VALUE",
        "value": 1
      }
    ],
    "bonus": [
      {
        "level": 5,
        "key": "deathGraceChance"
      }
    ]
  },
  "...": {
  }
}
Attribute Types
Bonuses

Restriction

A restriction requires:

A restriction can include:

{
  "name_it_as_you_want": {
    "replace": false,
    "skills": {
      "archery": 1,
      "health": 5
    },
    "blocks": [
      "minecraft:anvil"
    ],
    "crafting": [
      "minecraft:oak_planks",
      "minecraft:iron_sword",
      "minecraft:iron_chestplate"
    ],
    "entities": [
      "minecraft:villager"
    ],
    "items": [
      "minecraft:iron_sword"
    ],
    "mining": [
      "minecraft:pumpkin",
      "minecraft:stone",
      "minecraft:chiseled_polished_blackstone"
    ],
    "enchantments": {
      "minecraft:unbreaking": 1
    }
  },
  "...": {
    "skills": {
      "health": 1
    },
    "mining": [
      "minecraft:dirt"
    ]
  }
}

Information Display

To display information about a skill in the level gui, just add some lines in the lang json with the following key.
"skill.levelz.yourskillkey.0": "This is the whatever skill",
"skill.levelz.yourskillkey.1": "It does somethin",
...
Just increase the integer at the end of the json entry.

Disable access to something

To permanently disable access to something, simply set the skill requirement higher than the maxLevel property configured in levelz.json5.

Advancement

LevelZ provides two advancement criterions trigger called levelz:level and levelz:skill.\ The first one triggers when the player reached the set level.

    "criteria": {
        "levelexample": {
            "trigger": "levelz:level",
            "conditions": {
                "level": 100
            }
        }
    }

The second one triggers when the player reached the set skill level.

    "criteria": {
        "otherlevelexample": {
            "trigger": "levelz:skill",
             "conditions": {
                "skill_name": "health",
                "skill_level": 20
            }
        }
    }

Additional configuration

Levelz exposes configuration settings for many attributes, such as setting max levels, experience rates from different mobs, etc.. These configuration settings are found in ${MINECRAFTDIR}/config/levelz.json5

Commands

/level playername add skill integer

/level playername remove skill integer

/level playername set skill integer

/level playername get skill

Info

Inside the config there is a developer mode setting, when set to true, inside the creative menu, hover over an item/block with your mouse and press f8 (default key) to create or append the item/block id to the file called idlist.json inside your minecraft folder for easier datapack creation.