Foreword
In version 3.7.8, AOA3 was updated to MC1.21, and the original update content of the MC was also followed up, changing the spell of AOA3 to a data driver.This means that players can also use data packets to add, delete, and change the spell of AOA3.
In order to achieve the effect of the curse, AOA3 also added some of its own curse effect components. This tutorial will introduce information about these spell effect components and briefly introduce usage.
In order to achieve custom spells with data packets, readers also need basically knowledge:
For data packets, please refer to this page.
Mantra data format, this page has a detailed introduction.
Mantra Effect Component Introduction
The curse effect components added by AOA3 are all cursing effect components with conditional spell effects. The information is as follows:
The spells of the use of these components are introduced as follows:
crit_damage
The context of the component is Enchanted_damage, which affects the attack power of items with the curse.
The curse using this component is to be sever (before version 3.7.12), and the effect component is:
"effects": {"AOA3: Crit_damage": [← Effect component
{{
"Effect": {
"Type": "Minecraft: add", ← curse effect
"Value": {
"Type": "Minecraft: Linear", ← level dependency function "base": 1.15,
"Per_level_above_first": 1.15
}
}
}
]
},
In the effect component, the effect of the curse is Minecraft: ADD, which is the addition of the effect in the value effect.
The initial input is 0, so there is no curse (when the spell level is 0), the attack power is + 0, which is the same as the default value.
The value added to the input value is calculated by the level dependency function. This level dependency function is MINECRAFT: Linear (linear function).Base is 1.15, that is, when the curse is 1, the value of the input value = 1.15.PER_LEVEL_ABOVE_FIRST is 1.15, each increased by 1 of the curse level, this value increases by 1.15.
From the above analysis, it can be seen that the effect of the curse increases 1.15 crit damage per level.
spirit_consumption
The context of the component is Enchanted_item, which affects items with the curse itself.
The spell using this component is the energy, and the effect component is:
"effects": {"AOA3: Spirit_consumpting": [[
{{
"Effect": {
"Type": "AOA3: Clamp",
"Max": 9999.0,
"Min": 0.0,
"Value": {
"Type": "MINECRAFT: Multiply", "Factor": {
"Type": "Minecraft: Linear",
"Base": 0.93,
"Per_level_above_first": -0.07
}
}
}
}
]
},
In the effect component, the effect of the curse is MINECRAFT: Multiply, which is the effect of the multiplication of the values.
The initial input is 1, so there is no curse (when the spell level is 0), the consumption is × 1, which is the same as the default value.
The level dependency function of the additional value is AOA3: CLAMP. This level dependency function is re -coded and registered for the original Minecraft: CLAMP.This is between 0 and 9999.
Another level dependency function is linear introduced above. It is not difficult to see that it is 0.07 times the consumption of mental power per level, that is, a 7%schizophrenia consumption per level.
Then according to the previously compromes, if the value calculated through this method, if <0, set to 0;> 9999, set to 9999, to get the final value.
rune_cost
The context is enchanted_item, and I won't go into details.
The spell using this component is a spell, and the effect component is:
"effects": {"AOA3: Rune_cost": [[
{{
"Effect": {
"Type": "AOA3: Clamp",
"Max": 255.0,
"Min": 1.0, "value": {
"Type": "Minecraft: add",
"Value": {
"Type": "Minecraft: Linear",
"Base": -1.0,
"Per_level_above_first": -1.0
}
}
}
}
]
},
The effect is adding effects. The level dependency function is a combination of restraint and linear functions. It has also been introduced above, and I won't go into details.
The effect is to reduce the amount of rune consumption per level and restrain the results between 1 and 255.Try to interpret and analyze this effect yourself!
recoil
The spell using this component is dominated, and the effect component is:
"effects": {"AOA3: Recoil": [[
{{
"Effect": {
"Type": "MINECRAFT: Multiply",
"Factor": {{
"Type": "Minecraft: Linear",
"Base": 0.85, "per_level_above_first": -0.15
}
}
}
]
},
They are all familiar shadows!The effect is multiplication effect, and the level dependency function is a linear function.
It has been read here, I believe that it is not difficult to see that the effect is reduced by 15%of the recoil per level.
pellet_spread
The spell using this component is the bundle, and the effect component is:
"effects": {"AOA3: Pellet_spread": [[
{{
"Effect": {
"Type": "MINECRAFT: Multiply",
"Factor": {{
"Type": "Minecraft: Linear",
"Base": 0.85,
"Per_level_above_first": -0.15
}
}
}
]
},
The effect is multiplication effect, and the level dependency function is a linear function, which reduces the degree of bullet diffusion by 15%per level.
ammo_cost
The curse using this component is the curse of greedy, and the effect component is:
"effects": {"AOA3: AMMO_COST": [[
{{
"Effect": {
"Type": "Minecraft: add",
"Value": {
"Type": "Minecraft: Linear",
"Base": 1.0,
"Per_level_above_first": 1.0
}
}
}
]
},
The effect is adding effect. The level dependency function is a linear function, and the ammunition consumption is + 1 per level.
How to use these spell effect components
It can be seen from the above that the logic of AOA3's curse is still relatively simple, and the content of these curse effects is not complicated.These curse effect components are only responsible for providing the effect of effectiveness. The specific effect values and level dependency functions still use the original spell data format.
Therefore, players can also write their own spells with the methods provided by the original version.
A shallow example is inspired:
Design a curse, so that the firearm has a certain probability that it does not consume ammunition. The higher the level, the higher the probability.
First analyze the requirements, and infer what the need to use according to each needs.
The behavior is ammunition consumption, and the spell effect component responsible for ammunition consumption is AOA3: AMMO_COST, which is the mantra effect component we need.
The effect is to reduce probability, but the behavior of this component is to affect the consumption of ammunition.It seems different?
However, considering that the firearms are turned on, only one ammunition consumes one ammunition. If the consumption amount has a probability of -1, the effect we need.And the two decreases in the curse effect provided by the original version (Minecraft: Remove_binomial) just meets our requirements!
The higher the level, the higher the probability, and the card is almost played, and the level dependency function is required!
Based on the above analysis, we wrote the following effect components:
"effects": {"AOA3: AMMO_COST": [[
{{
"Effect": {
"Type": "Minecraft: Remove_binomial",
"CHANCE": {"Type": "Minecraft: Linear",
"Base": 0.07,
"Per_level_above_first": 0.07
}
}
}
]
},
After getting the effect component, the parameters required by other curse JSON, such as the maximum level, applicable items, etc. are better to write.
Outsider
There are also some AOA3 spells in the above not being introduced.
The cannonball curse directly uses the original spell effect component.
"effects": {"Minecraft: Damage": [[
{{
"Effect": {
"Type": "MINECRAFT: Multiply",
"Factor": {{
"Type": "Minecraft: Linear",
"Base": 1.1,
"Per_level_above_first": 0.1
}
}
}
]
},
The component is MINECRAFT: Damage, and the context is enchant_damage, that is, the attack power that affects items.The effect of the effect component is to increase the attack power by 10%per level.After version 3.7.12, cut off the curse.The new cutting curse also uses the original spell effect component.
"effects": {"Minecraft: Attributes": [[
{{
"Amount": {
"Type": "Minecraft: Linear",
"Base": 0.035,
"Per_level_above_first": 0.035
},
"Attribute": "Aoa3: Critical_hit_multiplier",, "
"ID": "AOA3: Enchntment.sever",
"Operation": "add_value"
}
]
},
The component is Minecraft: Attributes, that is, the curse gives the player a attribute modification, which affects the attribute value of the player.
The attribute modification, that is, the impact value of the attribute value is given by Attribute, which is AOA3: Critical_hit_multiplier. It is a newly defined attribute value of AOA3. This attribute value affects the player's crit damage damage.
The modified value is given by Amount, and it is still a level dependency function we are familiar with.The operation method of attribute modification is given by Operation to operate incremental.It is not difficult to see that the effect is increased by 0.035 at the level of the crit damage per level, that is, an increase of 0.035 times (3.5%) crit damage.
Due to the special effects of intervention and tight curse, the effect is still realized in the code.