跳到正文

Tycoon Skills

作者:Reinay97

A skill tree for modpacks: players pay money and experience to learn entries, and entries decide which items may be crafted, placed and used. The tree is written as a data pack.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Tycoon Skills

Learn it before you can use it.

Tycoon Skills gives a modpack a skill tree that decides what players may make. Every entry costs money and
experience, and every entry can unlock items – a single item, an item tag or a whole mod. Until a player has
learned the entry, a locked item cannot be crafted, placed or used. Iron tools after the first mine, steel
after iron, a tech mod only once you have paid for it – progression the pack controls, written as data.

This is a framework for pack makers. On its own the mod does nothing: it brings no tree. The tree comes
from the pack, as a data pack.

For players

  • Press K (or /skills) for the tree, drawn as a wheel: the branches around the middle, each branch’s
    steps running outwards. A step appears once the one before it is learned; learned fields turn gold. Drag to
    move the wheel.
  • Hover a field for what it costs and what it unlocks; click to learn it.
  • The cost is money and experience. The money comes from your Money account; experience is counted in
    points – the tooltip also tells you about which level that is. If the money is not there, you keep your
    experience.
  • Locked items say so. Their tooltip names the entry that frees them. The crafting table and the
    inventory grid show no result, placing and using are refused with a note in the action bar.
  • /skills list shows the tree as text.

Creative players are never locked. Machines of other mods that craft by themselves are not stopped – whoever
set them up had to learn them first.

A branch is a file

Each branch of the tree is one file, data/<namespace>/tycoonskills/branches/<branch>.json. The top level
is the branch’s own first entry, nodes are the steps after it. Every field except a node’s id is optional:

{
  "icon": "minecraft:stone_pickaxe",
  "order": 1,
  "xp": 50,
  "price": 100,
  "unlocks": ["minecraft:blast_furnace"],
  "nodes": [
    {
      "id": "iron_tools",
      "icon": "minecraft:iron_pickaxe",
      "xp": 160,
      "price": 500,
      "unlocks": ["minecraft:iron_pickaxe", "minecraft:iron_shovel", "minecraft:iron_axe"]
    },
    {
      "id": "steel",
      "parent": "iron_tools",
      "icon": "minecraft:anvil",
      "xp": 550,
      "price": 2500,
      "unlocks": ["#c:ingots/steel", "@mekanism"],
      "grants": ["mining.steel"],
      "items": ["minecraft:anvil"],
      "commands": ["effect give %s minecraft:haste 600 0"]
    }
  ]
}
  • xp – experience points (not levels: 160 points are about level 10, 550 about level 20).
    price – whole dollars.
  • unlocks – an item id, a tag with #, or a whole mod with @. An exact item beats a tag, a tag beats a
    mod. Items no entry names are free.
  • parent – the step that must be learned first (an id from the same file). Without it, the step hangs
    directly under the branch. order – the branch’s place in the wheel, clockwise from the top.
  • items are handed over once, commands run once at operator level (%s = the player’s name),
    grants are ability keys other mods can ask about.
  • icon and items must be items that exist – an unknown one makes the whole file fail (the log says
    which). unlocks may name items and mods that are not installed.
  • Names come from the language file: tycoonskills.skill.<branch>, tycoonskills.skill.<branch>.<step>
    and ...desc for the description.

Entries are saved as <branch>/<step> – renaming one forgets who had learned it. Because the tree is a data
pack, it can differ per world: with Tycoon Modes, each mode can bring its own prices.

For servers

Operators have /skills grant <player> <entry> and /skills revoke <player> <entry> – free, for testing and
for putting things right.

For mod developers

SkillsAPI.locked(player, item) – a shop should not sell a locked item. SkillsAPI.unlockedBy(item) names the
entry that frees it, SkillsAPI.can(player, ability) asks for a key from grants.

Requirements

  • Minecraft 1.21.1, NeoForge
  • Money (required) – 0.3.0 or later; entries are paid from the player’s account

Works in singleplayer and multiplayer: the tree comes from the server, learned entries are kept per player.


A note on how this was made

This mod was built with substantial help from AI. The design decisions, the playtesting and the
direction are mine; a large share of the code, the textures and this text was written with an AI
assistant. I would rather say that plainly than have you wonder.

Discord

Questions, bug reports, ideas, or just want to show what you built? Join the Discord –
that is where I answer fastest, and where the next version gets shaped.

常见问题

Tycoon Skills 支持哪些 Minecraft 版本?

Tycoon Skills 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

Tycoon Skills 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

Reinay97 的其他作品

查看全部 →