SlashBlade JS
A mod that provides developers with tools to customize and create recipes for the Slashblade: Resharped modification using KubeJS scripts, as well as working with plugin events.
Features and Applications
Here is a ready-to-use functionality example:
// priority: 0
/ Server Side /
// When checking blade charge state: if not charged, consumes 10 ProudSoul to activate
SlashBladeJSEvents.powerBlade(event => {
let state = BladeState.of(event.blade)
let proudsoul = state.proudSoulCount
if (!event.isPowered() && proudsoul >= 10) {
state.setProudSoulCount(proudsoul - 10)
event.setPowered(true)
}
event.user.tell("ProudSoul: " + proudsoul) // Notifies the player of current ProudSoul value
})
// Custom blade creation recipe
ServerEvents.recipes(event => {
event.recipes.slashblade.slashblade_shaped_recipe("slashblade:slashblade", [
"ABA",
"CSC",
"ABC"
], {
"S": SlashBladeIngredient.of(
SlashBladeRequestDefinition.name("slashblade:fox_black") // Required base blade
.killCount(233) // Required kill count
.proudSoul(114514) // Required ProudSoul amount
.refineCount(10) // Required refinement count
.addEnchantment(SBEnchantmentDefinition.of("minecraft:power", 2)) // Required enchantments
.build() // Don't forget to call .build()
),
"A": "minecraft:golden_apple", // Additional materials
"B": "#forge:bones",
"C": "minecraft:cake",
}, "slashblade:fox_white"/ Resulting blade ID /)
})
// Creating a custom blade
ServerEvents.highPriorityData(event => {
let customBlade = SBSlashBladeDefinition.of("kubejs:test_blade", // Your blade ID
SBRenderDefinition.newInstance() // Display properties
.effectColor(2039347) // Blade effect color (from hex RGB to decimal)
.standbyRenderType(SBCarryType.DEFAULT) // Sheathed position
.modelName("kubejs:model/named/test_blade.obj") // Path: ./kubejs/assets/kubejs/model/named/test_blade.obj
.textureName("kubejs:model/named/test_blade.png") // Path: ./kubejs/assets/kubejs/model/named/test_blade.png
.build(), // Don't forget to call .build()
SBPropertiesDefinition.newInstance()
.maxDamage(666) // Maximum durability
.baseAttackModifier(999) // Base attack damage
.slashArtsType("slashblade:void_slash") // Setting special attack
.addSpecialEffect("slashblade:wither_edge") // Adding special effect
.defaultSwordType([SBSwordType.FIERCEREDGE, SBSwordType.BEWITCHED]) // Setting blade types
.build(), // Don't forget to call .build()
[ // Default enchantments
SBEnchantmentDefinition.of("minecraft:power", 5),
SBEnchantmentDefinition.of("minecraft:unbreaking", 10)
]
)
// Registration in the game
event.addJson("kubejs:slashblade/named_blades/test_blade.json", SBSlashBladeDefinition.toJSON(customBlade))
})
Licensing
This mod is open source software distributed under the GPL v3.0 license. Compliance with license terms is mandatory when including in modpacks or using on servers.