-
Notifications
You must be signed in to change notification settings - Fork 0
(OUTDATED) Tutorial Part 2
Okay, so this is just gonna explain how the script is structured, so that you can add your own parts of it.
Effectively, at line 50 and beyond in the script is devoted to changes to modded tools. As explained in the script itself, you are able to tell which mod's tools are being edited by the "#onlyif modloaded <mod_id>" part above the section of the script you are looking at, closed by a line saying "#endif".
Let's give the example of adding combatibility to a theoretical mod named "Cool Emerald Tools" with the namespace "coolemeraldtools".> In your script (of which is inside your fork of this project), insert the following code right above the line with "#onlyif modloaded upgradednetherite".
#onlyif modloaded coolemeraldtools
//// Attack Speed
// Pickaxes
// Shovels
// Hoes
//// Attack Damage
// Pickaxes
// Shovels
// Hoes
#endif
This is the way I structure each individual mod's combatibility changes, however you can structure it however you want. (For the sake of the tutorial, I will be referencing this structure.)
Now, this is where the real fun begins. Using the example of the Cool Emerald Tools mod, look at the values of the Emerald Sword and Emerald Axe added by this mod. (In the example, the Emerald Sword has 9 Attack Damage and 1.6 Attack Speed, and the Emerald Axe has 11 Attack Damage and 1 Attack Speed.) Then, referencing the changes to Pickaxe/Shovel/Hoe Attack Damage/Speed from this mod, you can probably calculate what each of the Attack Damage/Speed values for each of the Emerald tools should be set to. Be sure to put this in some chart for future reference.
Once that's done, time to actually change the values according to your calculations. For Attack Damage, paste this code in its respective section for each of the attack damage values you want to set them to.
item:!!!ITEMIDHERE.anyDamage().addGlobalAttributeModifier(attribute:minecraft:generic.attack_damage, IItemStack.BASE_ATTACK_DAMAGE_UUID, "Tool modifier", !!!DAMAGEHERE, AttributeOperation.ADDITION, [constant:minecraft:equipmentslot:mainhand]);
(Replace the !!!ITEMIDHERE with your item id in the format "modid:item", which you can find the ID of any item ingame by doing F3+H to enable advanced tooltips, and hovering over the item in your inventory. Also, replace !!!DAMAGEHERE with the damage you want the tool to deal, minus one. If you wanted something to have 5 Attack Damage, put 4.0, since the damage is adding to your fist damage, which is 1.0.) For Attack Speed, paste this code into its respective section for each of the attack speed values you want to set them to.
item:!!!ITEMIDHERE.anyDamage().addGlobalAttributeModifier(attribute:minecraft:generic.attack_speed, IItemStack.BASE_ATTACK_SPEED_UUID, "Tool modifier", !!!SPEEDHERE, AttributeOperation.ADDITION, [constant:minecraft:equipmentslot:mainhand]);
(Again, replace the !!!ITEMIDHERE with your item id as explained above, and replace !!!SPEEDHERE with the speed you want the tool to have, minus 4. (It's completely normal for this number to go into the negatives.) If you wanted something to have 1.2 Attack Speed, put -2.8, since the attack speed is adding to (or subtracting from) your fist's base attack speed, which is 4.0.)
And voila, you're done!