Elementelum,名称源于“Element”(元素)与“Weapon”(武器)的结合……
当然,这个项目主要围绕元素武器展开,但其中远不止于此。
如果你想对新增内容有一个全面的了解,请观看 YouTube 上的评测视频:
vred's DP Lib 是必需的!
本项目添加了以下内容:
- 具有不同层级(苍白 → 石质 → 元素)的新颖且令人兴奋的武器;每个层级比前一个层级拥有更多的能力;
- 内置对 Iron's Spells and Spellbooks 的兼容,现在每种能力都将消耗法力值。
- 锻造系统;
- 数据驱动的增强系统;
- 武器和增强的完全可配置属性。
技术方面
有用命令
/function elementelum:get_materials
获取所有材料和增强!
/function elementelum:get_weapons
获取所有武器!
如何添加自定义增强
要制作自定义增强,你需要:
- 3 个物品修饰器;
- 带有特定自定义数据的物品;
- 1 或 2 个函数;
- 1 个附魔(可选)。
物品修饰器
# data/<namespace>/item_modifier/augments/<augment>/normal.json
在锻造小游戏击中黄色部分时应用。
# data/<namespace>/item_modifier/augments/<augment>/perfect.json
在锻造小游戏击中红色部分时应用。
# data/<namespace>/item_modifier/augments/<augment>/remove.json
移除增强时应用。
<namespace> 和 <augment> 在物品本身中定义。
这里有一个示例:
give @s raw_cod[custom_data={vred_lib:{augment:fish,namespace:example, item_type:augment}}]
# data/example/item_modifier/augments/fish/normal.json
# data/example/item_modifier/augments/fish/perfect.json
# data/example/item_modifier/augments/fish/remove.json
函数
需要一个函数来在将增强放入神秘砧台时添加自定义文本。若要添加与其他增强类似的文本,建议参考原始代码。
该函数需要位于 #elementelum:augment/desc 函数标签中。
data modify storage elementelum:augment text.<namespace>.<augment>.normal set value '[...]'
data modify storage elementelum:augment text.<namespace>.<augment>.perfect set value '[...]'
如果你想使用相同的行为来根据背包中增强数量改变等级,只需使用 function elementelum:augments/calc/base {namespace:<namespace>,augment:<augment>}
然而,这需要 ID 为 "<namespace>:<augment>" 的自定义附魔。
<namespace> 和 <augment> 与之前物品中的相同。
武器的可配置值
如果你想配置武器的某些能力,例如:
你需要查看物品本身,并使用 /scoreboard 来修改这些值。
例如,我们要编辑 Thalassurge 的基础伤害。
我们需要知道内部物品 ID(可能与显示名称不完全相同)
首先,我们复制该物品并将其拿在主手中。
然后运行以下命令:
data get entity @s SelectedItem.components.minecraft:custom_data.vred_lib
之后,尝试在命令结果中找到 "weapon_id" 的值。在这种情况下它是 anchor(是的,我还没改它 ?)。
解压数据包并找到这个函数:
data/elementelum/function/<weapon_id>/config/base.mcfunction
(它将是 data/elementelum/function/anchor/config/base.mcfunction)
在该函数中将包含所有配置值,你可以使用 /scoreboard 对其进行调整以进行修改。
我们想要编辑 Thalassurge 的基础伤害,现在我们知道了可以使用此命令:
scoreboard players set $anchor.atk.dmg elementelum.config 5
如果你想重置值,只需执行
/function elementelum:<weapon_id>/config/reset
(它将是 /function elementelum:anchor/config/reset)
Elementelum, name born from the combination of "Element" and "Weapon"...
Of course, this project is mostly about Elemental Weapons, but there's much more.
If you want a great overview of the added content, check out the youtube review:
vred's DP Lib IS REQUIRED!!
This project adds:
- new and exciting weapons that have different tiers (pale -> stoichite -> elemental). Each tier has more abilities than the previous one;
- built-in Iron's Spells and Spellbooks compat, where each ability will now use mana.
- forging system;
- datadriven augment system;
- fully configurable stats for weapons and augments.
Technical side
Useful commands
/function elementelum:get_materials
To get all materials and augments!
/function elementelum:get_weapons
To get every weapon!
How to add custom augments
In order to make a custom augment you need:
- 3 item modifiers;
- item with specific custom data;
- 1 or 2 functions;
- 1 enchant (if you want).
Item modfiers
# data/<namespace>/item_modifier/augments/<augment>/normal.json
Will be applied when hitting the yellow part in the forging minigame.
# data/<namespace>/item_modifier/augments/<augment>/perfect.json
Will be applied when hitting the red part in the forging minigame.
# data/<namespace>/item_modifier/augments/<augment>/remove.json
Will be applied when augment is removed.
<namespace> and <augment> are defined into the item itself.
here's an example:
give @s raw_cod[custom_data={vred_lib:{augment:fish,namespace:example, item_type:augment}}]
# data/example/item_modifier/augments/fish/normal.json
# data/example/item_modifier/augments/fish/perfect.json
# data/example/item_modifier/augments/fish/remove.json
Functions
A function is needed to add custom text when the augment is put in the Esoteric Anvil. To add something similar to the text of other augments, it's better to look at the orignal code.
The function needs to be in the #elementelum:augment/desc function tag.
data modify storage elementelum:augment text.<namespace>.<augment>.normal set value '[...]'
data modify storage elementelum:augment text.<namespace>.<augment>.perfect set value '[...]'
If you want to use the same behavior to change the level based on quantity of augment in your inventory, just use function elementelum:augments/calc/base {namespace:<namespace>,augment:<augment>}
However, it will require a custom enchantment with the id "<namespace>:<augment>".
<namespace> and <augment> are the same from the item as before.
Configurable values for weapons
If you want to configure some of the abilites of the weapons, such as:
- cooldown
- damage
- duration.
You need to check the item itself and use /scoreboard to modify the values.
For example, we want to edit the base damage of Thalassurge.
We need to know the internal item id (which may not always be the same as the display name)
First of all, we take a copy of said item and hold it in our main hand.
Then we run this command:
data get entity @s SelectedItem.components.minecraft:custom_data.vred_lib
After that, try to find the value of "weapon_id" in the command result. In this case it's anchor (yes, I still haven't changed it ?).
Unzip the datapack and find this function:
data/elementelum/function/<weapon_id>/config/base.mcfunction
(it will be data/elementelum/function/anchor/config/base.mcfunction)
In that function will be all the values of the config, you can tinker around with them using /scoreboard to modify them.
We wanted to edit the base damage of Thalassurge, now we know we can do it using this command:
scoreboard players set $anchor.atk.dmg elementelum.config 5
If you want to reset the values, just
/function elementelum:<weapon_id>/config/reset
(It will be /function elementelum:anchor/config/reset)
评论 0
登录后参与评分
还没有评论,来抢沙发吧