Slash Blade Tweaker - Customize Blades to Your Liking
This tool allows complete customization of blade characteristics, special attacks, and effects through ZenScript, providing unlimited possibilities for weapon personalization.
Blade Types
In the Drawn Swords modification, different types of knives represent the same item with different NBT parameters. The system contains a registry storing original blade samples, while those obtained by players are their exact copies.
To register a new blade type, simply add "Knife Original" to the registry. The most convenient method is using the BladeRegistry chain:
BladeRegistry
.named("example:test_one").killCount(10000).refine(1000).proudSoul(2600000)
.texture("named/sange/white").model("named/sange/sange").specialAttack(20).wrap(BladeRegistry.findItem("minecraft:wooden_sword"))
.process(function(s as crafttweaker.item.IItemStack){SERegistry.addSEToItem(s, "test_se");return s;}).register()
.named("example:test_two").register();
First, the name is specified, then parameters are configured, and the process is completed with the register() call. Such a chain can be arbitrarily long.
Special Attacks (SA)
Special Attack refers to unique combat techniques available when using a drawn sword. Each SA is identified by a numerical code in NBT. Registration is done using:
SARegistry.registerSA(int, String, ISpecialAttackFunction)
Translation key for the name: flammpfeil.slashblade.specialattack.%NAME%. The ISpecialAttackFunction is called on both client and server when the attack is used.
Effects (SE)
SE represent additional effects stored in NBT. They don't have their own functionality but are used as information similar to enchantments. Registration is done with a string identifier:
SEType.create(10, "example_se").register();
The first parameter is the default effect level, the second is the name. Translation key: slashblade.seffect.name.%NAME%. SE can be added through direct NBT modification or using SERegistry#addSEToItem.
Additional Features
Wrapping
The built-in wooden sword of the White and Black Fox can be replaced via the wrap parameter when creating BladeType. Attacking with a drawn sword is equivalent to attacking with the built-in item.
In creative mode, a line is displayed below the knife panel: "is demo item. is wooden sword true performance : please crafting", meaning this is a demonstration blade with wooden sword power, true power can only be obtained through crafting.
When synthesized using the "Nameless" Ruby, a sharp sword created from a katana inherits its abilities, durability, and damage. SA represents the damage of each phantom blade type and additionally increases the sword's base damage by +4.
Re-registration
BladeRegistry#reregister(String,IItemStack) allows forced registration of an ItemStack under a blade name, overriding or modifying its parameters.
Modification example:
val blade as IItemStack = BladeRegistry.getBladeItemStack("flammpfeil.slashblade.named.fox.white");
BladeUtils.setKillCount(blade, 114514);
BladeRegistry.reregister("flammpfeil.slashblade.named.fox.white", blade);
This way, the default kill count for the "White Fox" sword becomes 114514, and it can be immediately taken from the creative mode inventory.