#How can i get this sword item to work?

8 messages · Page 1 of 1 (latest)

patent latch
#

StartupEvents.registry("item", (event) => {
event
.create("combat_knife")
.displayName("§aCombat Knife") // Green display name
.maxStackSize(1) // Make it unstackable like weapons
.tiered((tiered) => {
tiered
.attackDamageBaseline(5) // Base attack damage (equivalent to an iron sword)
.durability(250) // Durability of the knife
.attackSpeedBaseline(2.0); // Faster attack speed than most weapons
});
});

late hornetBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

astral magnetBOT
#

You can write your code in a codeblock by typing it between the codeblock delimiters:
Note that these are backticks, not apostrophes

```js :arrow_left:

ServerEvents.recipes(event => {
event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

This example will look like this:

ServerEvents.recipes(event => {
  event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
drowsy spire
#
.create("combat_knife",  "sword")```
patent latch
drowsy spire
#
e.create('iron_sword', 'sword').attackDamageBaseline(3).speedBaseline(-2.4)
patent latch
#

Thank you ill try my best I'm super new to kubejs thank you for your help and patience!

patent latch
#

Hey I wanted to thank you for your help! Your code worked and I was able to create my sword item