Setworks
Set bonuses for equipment, defined by your pack in ZenScript or by mods through an API, shown in item tooltips.
截图
介绍
Setworks adds set bonuses for equipment. A modpack or a mod defines sets of items and the bonuses for wearing or carrying enough of them. Setworks counts the pieces, applies the bonuses, and shows all of it in item tooltips. It ships no sets of its own, so it changes nothing until a pack or a mod defines some.
Similar results are possible with Set Bonus together with CTSetBonus. Setworks puts what those two do into one mod, with scripts, an API, and the tooltips.
AI usage disclaimer: This mod was developed with AI-agent assistance using this agent workflow. The project owner reviewed the work during development.
For players
- An item that belongs to a set shows a block in its tooltip: the set name with how many pieces you have on, then one line per bonus with the piece count it needs. A bonus line turns green once you have the pieces.
- Hold Shift to see the named pieces of the set and which ones you have.
- Some bonuses stay unlisted until you have had them active once.
For pack authors
Sets are defined in ZenScript with CraftTweaker. Put the file in scripts/ with #loader setworks on its first line, so it runs after every mod registered its items.
#loader setworks
import mods.setworks.Setworks;
Setworks.armorSet("mypack:gold_armor", "Golden Armor",
<minecraft:golden_helmet>, <minecraft:golden_chestplate>, <minecraft:golden_leggings>, <minecraft:golden_boots>);
Setworks.bonus("mypack:gold_glow", "mypack:gold_armor", 4, "Golden Glow: +2 armor and Night Vision")
.attribute("generic.armor", 2, "add")
.potion("minecraft:night_vision", 1);
- A piece accepts any items you list, including ore dictionary entries and items with NBT.
- A piece can sit in an armor slot, a hand, the hotbar, the inventory, or a Baubles slot when Baubles is installed.
- A bonus needs a piece count of one set, or of several sets at once, for example full armor plus a weapon in hand.
- A bonus can add attribute modifiers and potion effects, or carry none and leave the behavior to your script, which reads the bonus state through
player.hasSetworksBonus(id)and theevents.onSetworksBonusActivatedevent. - A bonus can have a condition: a built-in one, or a script function
function(player as IPlayer) as bool. - With Potion Core installed, a bonus can also change its seven player stats: damage resistance, dig speed, jump height, magic damage, magic shielding, projectile damage, and step height.
- A bonus can be always listed, listed once a player had it, or never listed.
- A script can replace, change the text of, or disable a set that a mod defined.
/setworks listand/setworks validateshow what loaded and what was rejected and why. A changed script needs a game restart.
The scripting reference describes every call with examples: locations, item patterns, effects, conditions, visibility, changing another mod’s sets, queries, and events.
The example scripts show the full surface: an armor set with a weapon set, a hidden bonus that needs both, a script function as condition, event handlers, and a script that changes a set another mod defined.
For mod developers
A Java API does the same without CraftTweaker. With it a mod can:
- Register its own sets and bonuses when it loads, or replace and disable sets from other sources.
- Add a new kind of effect, for example a stat from its own system, that any set can then grant. The kind is told when a bonus ends and when the player leaves, and once when a batch of changes is complete, so a stat with a maximum can be clamped at the right moment.
- Add a new kind of condition that any bonus can use.
- Expose its own equipment slots as locations, the way the Baubles slots are exposed.
- Ask whether a player has a bonus active, or listen for bonuses turning on and off.
Configuration
config/setworks.cfg: strict validation (stop at startup on an invalid definition; off by default), the condition interval (every second by default), the vanilla example sets (off by default), a diagnostic log for operators (off by default), and a client switch for the tooltip block (on by default). A change needs a restart.
Installation
Install on the server and on every client. CraftTweaker, Baubles, and Potion Core are optional and only needed for the features above that name them.
Source and issues: github.com/mahghuuuls/setworks
常见问题
Setworks 支持哪些 Minecraft 版本?
Setworks 支持 Minecraft Java 版 1.12.2,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。
Setworks 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
Mahghuuuls 的其他作品
查看全部 →Inventory Tweaks Remove Settings Button Config
Inventory Tweaks 模组的分支,添加了一个配置选项,用于从 GUI 中移除“...”按钮
TreeChopper Durability Config
Fork of MrDuchy's TreeChopper mod, it adds a single config option to reduce (or increase) the durability loss of the axe when a tree is chopped whole.
Just Another Wizardry Mana System
Replaces Electroblob’s Wizardry wand mana with a deeply configurable player mana system
CTSetBonus
CraftTweaker integration with Set Bonus mod.
评论
登录后评论和评分