StartupEvents.registry('item', event => {
Platform.mods.kubejs.name = 'Shattered Realms'
event.create('realm_carver', 'sword')
.displayName('Realm Carver'),
.attackDamageBaseline(30.0),
.nbt({unbreakable:1, affix_data:{rarity:"apotheosis:ancient"}, sockets:5, weapon_attributes:{"parent":"bettercombat:sickle"})});
}
#not sure how to fix my script
36 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
minecraft gives me an error when i launch saying "missing } after property list but im not sure where
If you're working with KubeJS scripts, config files, or similar things, we generally recommend using an actual IDE rather than just Notepad++ and its various siblings.
In a lot of cases, it can help you find errors in your code faster and also gives you neat features like syntax highlighting, automatic formatting, etc!
We recommend Visual Studio Code, since it's lightweight(-ish) and works very well with JavaScript files out-of-the-box.
In fact, the issue is different and VS Code would catch it immediately.
im using vs code
i got the syntax right i think
but apparently .nbt isnt a valid function
StartupEvents.registry('item', event => {
Platform.mods.kubejs.name = 'Shattered Realms'
event.create('realm_carver', 'sword')
.displayName('Realm Carver')
.attackDamageBaseline(30.0)
.nbt({unbreakable:1, affix_data:{rarity:"apotheosis:ancient"}, sockets:5, weapon_attributes:{"parent":"bettercombat:sickle"}})});
StartupEvents.registry("item", (event) => {
Platform.mods.kubejs.name = "Shattered Realms";
event
.create("realm_carver", "sword")
.displayName("Realm Carver")
.attackDamageBaseline(30)
.nbt({
unbreakable: 1,
affix_data: { rarity: "apotheosis:ancient" },
sockets: 5,
weapon_attributes: { parent: "bettercombat:sickle" },
});
});
also how do you have it so it highlights and says what's wrong with your code
It should be built-in
But I also use an extension called "Error Lens" which puts the errors directly into code
Also, 30.0 does nothing different than 30 in JS
There's only one type of number: number, which is equivalent to a double in strongly typed languages
This would be different if this were Java
Yes, in Java, 30.0 will become a double and 30 will become an int
double is just the term right
Double precision float
With ProbeJS type checking:
I don't think you can even set NBT during item creation