RPG 等级提升
玩家等级、可分配的属性点以及随等级缩放的小怪——完全由数据包驱动,专为整合包制作者打造。
灵感来源于 PlayerEx、Mine and Slash 和 RPG 属性系统。适用于 Forge 1.20.1。
功能特性
- 玩家升级 — 通过击杀获取经验值,升级并获得属性点
- 全屏属性界面 — 按
K 键查看等级、经验值和可用点数
- 自定义属性 — 默认包含力量、活力、防御、敏捷、幸运;可通过 JSON 添加你自己的属性,包括来自其他模组的属性
- 小怪缩放 — 小怪的生命值、伤害和护甲随玩家等级和区域等级增长
- 稀有小怪 — 精英和小怪带有随机词缀(吸血、火焰、荆棘……),提供额外经验值并显示发光轮廓
- Boss — 固定等级:末影龙 100,凋灵 80,监守者 90(可配置)
- 区域等级 — 每个维度、生物群系和结构的最小小怪等级,以及距出生点距离带来的等级增长
- 数据包小怪规则 — 通过支持实体标签的 JSON 文件设置黑名单、Boss 等级和倍率,支持
/reload 实时重载
- 反刷怪农场 — 可选跳过来自刷怪笼和生成蛋的小怪
- 可配置的经验曲线 — 公式加上每级覆盖值
- 共享击杀经验 — 对怪物造成其最大生命值 20% 以上伤害的玩家均可获得经验
对于玩家
击杀小怪以获取经验值并升级。按 K(可重新绑定)打开属性界面并分配点数。如果服务器允许,可以退还点数或进行完整重置。HUD 会显示你的等级、经验进度和当前区域等级。小怪名称会显示其等级,颜色根据危险程度变化,精英和小怪会有星星标记。
对于整合包开发者
所有内容均位于 config/rpgleveling/(四个 TOML 文件加上 stats.json)和数据包中。无需修改代码,无需重新构建。
自定义属性 (stats.json)
属性是数据而非代码。一个属性可以驱动多个属性,包括模组自带的属性:
[
{
"id": "spell_power",
"name": "奥术",
"maxPoints": 50,
"modifiers": [
{ "attribute": "irons_spellbooks:spell_power", "perPoint": 0.02, "operation": "MULTIPLY_TOTAL" }
]
}
]
操作类型:ADDITION、MULTIPLY_BASE、MULTIPLY_TOTAL。在游戏中使用 /rpgstat add、/rpgstat remove、/rpgstat reload(带属性自动补全)进行管理。
经验曲线 (player.toml)
xpBase = 50.0 # 所需经验值 = xpBase * level ^ xpGrowth
xpGrowth = 1.5
xpLevelOverrides = ["49=250000"] # 可选的每级覆盖值
pointsPerLevel = 2
statCostIncreaseEvery = 10
击杀经验公式:(xpKillBase + xpPerMobLevel * mobLevel) * rarityMultiplier * dimensionXpMultiplier
小怪缩放 (mobs.toml)
小怪等级 = max(区域等级, 最近玩家等级) 并带有随机方差,受维度最小等级限制。
globalIntensity = 1.0 # 总体难度旋钮
healthPerLevel = 0.10 # 每级增加 10% 生命值
ignoreSpawners = false # 反刷怪农场
ignoreSpawnEggs = false
blocksPerAreaLevel = 500 # 距出生点每 500 格增加 1 个区域等级
精英和小怪的几率、倍率和词缀池也在同一文件中。
区域等级 (world.toml)
构建合适的 RPG 区域:
dimensionMinLevels = ["minecraft:the_nether=30", "minecraft:the_end=60"]
biomeMinLevels = ["minecraft:deep_dark=45"]
structureMinLevels = ["minecraft:ancient_city=50"]
数据包小怪规则
将 JSON 文件放入任何数据包的 data/<your_namespace>/rpgleveling/mob_rules/ 路径下:
{
"blacklist": ["minecraft:villager", "#minecraft:skeletons", "create:*"],
"boss_levels": { "cataclysm:ender_guardian": 85 },
"multipliers": { "#minecraft:raiders": 1.5 }
}
支持精确 ID、实体标签 (#namespace:tag) 和整个命名空间 (mod_id:*)。规则与配置文件列表合并,并通过 /reload 实时重载。
命令 (op)
/rpglevel get | set | addxp | addpoints | reset <player> — 管理玩家等级
/rpgstat list | add | remove | reload — 管理属性定义
/rpgstat respec <player> — 退还所有点数
兼容性与性能
- 可与任何模组的实体和任何模组的属性配合使用
- 小怪数据存储于实体 NBT 中——在区块卸载和重启后安全保留
- 区域等级查找按区块部分缓存,繁重的工作仅在每次生成小怪时执行一次
- 客户端和服务器端均需安装
RPG Leveling
Player levels, spendable stat points, and level-scaled mobs — fully data-driven for modpack makers.
Inspired by PlayerEx, Mine and Slash and RPG attribute systems. Forge 1.20.1.
Features
- Player leveling — earn XP from kills, level up, get stat points
- Fullscreen stats UI — press
K to view level, XP and spend points
- Custom stats — Strength, Vitality, Defense, Agility, Luck by default; add your own via JSON, including attributes from other mods
- Mob scaling — mob health, damage and armor grow with player level and area level
- Rare mobs — Elite and Legendary mobs with random affixes (vampiric, fiery, thorny...), bonus XP and glowing outline
- Bosses — fixed levels: Ender Dragon 100, Wither 80, Warden 90 (configurable)
- Area levels — minimum mob level per dimension, biome and structure, plus growth with distance from spawn
- Datapack mob rules — blacklist, boss levels and multipliers via JSON with entity tag support, live
/reload
- Anti mob-farm — options to skip mobs from spawners and spawn eggs
- Configurable XP curve — formula plus per-level overrides
- Shared kill XP — everyone who dealt 20%+ of the mob's max HP gets XP
For players
Kill mobs to gain XP and level up. Press K (rebindable) to open the stats screen and spend points. Refund points or full respec if the server allows it. The HUD shows your level, XP progress and current zone level. Mob names show their level colored by danger, with stars for Elite and Legendary mobs.
For modpack developers
Everything lives in config/rpgleveling/ (four TOML files plus stats.json) and in datapacks. No code, no rebuilds.
Custom stats (stats.json)
Stats are data, not code. One stat can drive several attributes, including modded ones:
[
{
"id": "spell_power",
"name": "Arcane",
"maxPoints": 50,
"modifiers": [
{ "attribute": "irons_spellbooks:spell_power", "perPoint": 0.02, "operation": "MULTIPLY_TOTAL" }
]
}
]
Operations: ADDITION, MULTIPLY_BASE, MULTIPLY_TOTAL. Manage in-game with /rpgstat add, /rpgstat remove, /rpgstat reload (with attribute autocomplete).
XP curve (player.toml)
xpBase = 50.0 # XP needed = xpBase * level ^ xpGrowth
xpGrowth = 1.5
xpLevelOverrides = ["49=250000"] # optional per-level overrides
pointsPerLevel = 2
statCostIncreaseEvery = 10
Kill XP formula: (xpKillBase + xpPerMobLevel * mobLevel) * rarityMultiplier * dimensionXpMultiplier
Mob scaling (mobs.toml)
Mob level = max(area level, nearest player level) with random variance, clamped by dimension minimum.
globalIntensity = 1.0 # master difficulty knob
healthPerLevel = 0.10 # +10% HP per level
ignoreSpawners = false # anti mob-farm
ignoreSpawnEggs = false
blocksPerAreaLevel = 500 # +1 area level per 500 blocks from spawn
Elite and Legendary chances, multipliers and the affix pool are in the same file.
Area levels (world.toml)
Build proper RPG zones:
dimensionMinLevels = ["minecraft:the_nether=30", "minecraft:the_end=60"]
biomeMinLevels = ["minecraft:deep_dark=45"]
structureMinLevels = ["minecraft:ancient_city=50"]
Datapack mob rules
Drop JSON files into any datapack at data/<your_namespace>/rpgleveling/mob_rules/:
{
"blacklist": ["minecraft:villager", "#minecraft:skeletons", "create:*"],
"boss_levels": { "cataclysm:ender_guardian": 85 },
"multipliers": { "#minecraft:raiders": 1.5 }
}
Supports exact ids, entity tags (#namespace:tag) and whole namespaces (mod_id:*). Rules merge with the config lists and reload live with /reload.
Commands (op)
/rpglevel get | set | addxp | addpoints | reset <player> — manage player levels
/rpgstat list | add | remove | reload — manage stat definitions
/rpgstat respec <player> — refund all points
Compatibility and performance
- Works with any mod's entities and any mod's attributes
- Mob data is stored in entity NBT — safe across chunk unloads and restarts
- Area-level lookups are cached per chunk section, heavy work happens once per mob spawn
- Required on both client and server
评论 0
登录后参与评分
还没有评论,来抢沙发吧