#No rarity modification with ISS Spellbooks

130 messages · Page 1 of 1 (latest)

wild verge
#

If you try to change the rarity of any item that is an irons_spells_js:spellbook you get a crash on startup. Not sure if this is something that can be implemented or not, but it would be kinda nice for the sake of custom spellbooks. (Not every spellbook is made equally therefore they can't all be uncommon lol) Or if there is a different method of changing rarity of spellbooks that would be great.

orchid dragonBOT
#

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

umbral dove
#

The mod has rarity options in the server config.

terse furnace
#

I think the op is trying to change the minecraft rarity of the item which is hardcoded by the mod.

#

Not the spell rarity

wild verge
#

yea the Item Rarity not spell rarities

#

it is a custom spellbook added with SpellJS but you cannot use the normal item.rarity to change the items rarity

umbral dove
#

You can't set it in the item builder at startup?

wild verge
#

I don't think that rarity is in the spellbook registry at all, so you can't modify it because its assigned in a different way

#

I think that the rarity is directly assigned to "spellbooks" rather than the items themselves

umbral dove
#

It's @coarse light 's mod, so i guess that's who needs to answer. Or @verbal solstice

coarse light
wild verge
#

it must be the way that ISS assigns certain things to items, like scrolls are also uncommon items by default when you make a new one, you can change the rarity of Swords and staves and armor, so i'm not sure

#

I understand why scrolls work that way, but spellbooks is weird

coarse light
#

oh i see what you're doing

#

i don't recommend using item modification events for this

coarse light
wild verge
#

yea 1 sec

umbral dove
snow trailBOT
wild verge
#

different error

coarse light
#

can you show your full code?

wild verge
#
StartupEvents.registry("item", event => {
    // Other item methods also work on these builders. It is recommended to give the spell books the proper Curios item tag for them to work properly.
    // (that being "curios:spellbook")

    //This just creates a basic spell book with nothing special to it. It is given 3 spell slots as defined.
        event.create("astral_spellbook", "irons_spells_js:spellbook")
            .setMaxSpellSlots(10)
            .addDefaultAttribute("kubejs:astral_spell_power", "Astral Spell Power", 0.15, "multiply_total")
            .addDefaultAttribute("irons_spellbooks:max_mana", "Max Mana", 150, "addition")
            .rarity('EPIC')
#

it does specifically say other item methods work

coarse light
#

they should

#

@verbal solstice can you take a look at this for me? kinda occupied rn

wild verge
#

older different thing but wahhh

coarse light
#

in dev, that issue is fixed

#

if you need a temporary build of the mod then i can send it here

wild verge
#

ah I just misunderstood I thought it got released already thats ok

coarse light
#

yeah, we're trying to iron out (pun intended) some issues, including this one, and then the update should be out soon

wild verge
#

awesome, seems im guinea pigging the mod along

coarse light
#

seeing people use the mod gives me motivation to work on it more

#

okay so i think i see the issue

wild verge
#

well I'll be using it until I've got a whole school + some other mod crossover for my modpack

#

oh?

coarse light
#

we're using BuilderBase<SpellBook> and not ItemBuilder, so that may be causing issues

#

i'm gonna have to convert it to ItemBuilder

wild verge
#

your mod will be perfect one day, it'll have to be because I'm gonna use all of it heh

wild verge
#

on it

snow trailBOT
#

Paste version of startup.log from @wild verge

coarse light
#

woah what the hell

#

oh

#

thonk did you actually download the mod?

#

i don't see the plugins being loaded at all

#

at the top of those logs it should show that our plugin is there

wild verge
#

I did but for some reason instead of replacing the existing one it just deleted both lmao

coarse light
#

lmao

wild verge
#

ok lets try this again with the mod this time

#

so it did break 2 things, and it mightve fixed the rarity bug? (but caused a new one)

coarse light
#

can you send your latest.log?

#

and code

wild verge
snow trailBOT
#

Paste version of latest.log from @wild verge

wild verge
#

and then code for both errors?

coarse light
#

yeah

#

oh wait

#

i know the issue with the first one

#

i changed the way setUniqueInfo works

wild verge
#
StartupEvents.registry('item', event => {
    event.create('sun_core').displayName('Sun Core')
})
ItemEvents.modification(event => {
    event.modify('kubejs:sun_core', item => {
      item.maxStackSize = 64
      item.fireResistant = true
      item.rarity = 'MYTHIC'
    })
})
StartupEvents.registry('item', event => {
    event.create('star_fragment').displayName('Star Fragment')
})
ItemEvents.modification(event => {
    event.modify('kubejs:star_fragment', item => {
      item.maxStackSize = 64
      item.fireResistant = true
      item.rarity = 'EPIC'
    })
})
ItemEvents.modification(event => {
    event.modify('kubejs:the_sun_the_moon_the_stars.', item => {
      item.maxStackSize = 1
      item.fireResistant = true
      item.maxDamage = 4056
      item.rarity = 'MYTHIC'
    })
  
    event.modify('kubejs:constellation', item => {
      item.rarity = 'MYTHIC'
      item.maxDamage = 3236
    })
  })
ItemEvents.modification(event => {
    event.modify('kubejs:moon_staff', item => {
        item.rarity = 'celestial'
    })
})
ItemEvents.modification(event => {
    event.modify('minecraft:nether_star', item => {
        item.rarity = 'legendary'
    })
})
#

and then this is code that has MYTHIC rarity in it, which is from aquamirae

coarse light
#

it would be

.setUniqueInfo((level, caster) => {
    return [Component.of(`Level Test: ${level}`), Component.of(`Caster Test: ${caster}`)]
})

for the unique info now

#

the second error shows that you are inputting a non-existent rarity

wild verge
#

which is strange because all of this code was working prior

coarse light
#

the error shows all valid rarities

#

did you remove any mods that added rarities?

wild verge
#

nope, mythic is from aquamirae, here is an example of one of the items in game with the rarity

coarse light
#

knowing aquamirae, that is probably not actually registered as a rarity, but instead just some hardcoded stuff

#

wait

wild verge
#

no like this is an item I made assigned with the rarity

ItemEvents.modification(event => {
    event.modify('kubejs:sun_core', item => {
      item.maxStackSize = 64
      item.fireResistant = true
      item.rarity = 'MYTHIC'
    })
})
coarse light
#

huh

#

that's odd

#

can you try inputting a different rarity and see if that changes anything?

wild verge
#

testing with the uniqueInfo and different rarity

#

my game and my discord crashed lmao sending logs

snow trailBOT
#

Paste version of latest.log from @wild verge

wild verge
#

oh wait might know the reason, I think there was already an instance opened and it overloaded my RAM

coarse light
#

i was about to say

#

this does not look like a kjs issue raha

wild verge
#

ugh getting the rarity crash again, I forgot about my rarity array script...

#

isnt there a way to easily disable something?

coarse light
wild verge
#

I just dragged the scripts out of the folder, the picture above is an example script I've been using to assign rarities to items easier, and it has alot of mythics items lmao

snow trailBOT
#

In 1.19.2 you can use various headers at the top of a script to change its load conditions.
For example:

//ignored: true
console.log("I am never printed")
//packmode: default
console.log('I will only print when packmode in kubejs/config/common.properties is set to default')
//requires: minecraft
//requires: create
console.log('I will only print when mods with ids of minecraft AND create are loaded')

You can stack these too, like so

//priority: 10
//packmode: hard
//requires: create
//requires: tconstruct
console.log('I am complicated!')
wild verge
#

and the celestisynth rarity is no longer working either...

#

ok game booted, no errors, this script didnt change the rarity however

event.create("astral_spellbook", "irons_spells_js:spellbook")
            .setMaxSpellSlots(10)
            .addDefaultAttribute("kubejs:astral_spell_power", "Astral Spell Power", 0.15, "multiply_total")
            .addDefaultAttribute("irons_spellbooks:max_mana", "Max Mana", 150, "addition")
            .rarity('EPIC')
#

and the previously mentioned rarities for some reason no longer existing in the list despite working in game still

#

and obviously this worked as intended

coarse light
#

testing it in devenv rn

wild verge
#

No startup errors or anything either

coarse light
#

yeah that's why i'm confused

#

thonk i think i know what's happening here...
i think every spellbook is hardcoded to be uncommon

#

lemme see something

#

no wait huh

#
    public static final RegistryObject<Item> WIMPY_SPELL_BOOK = ITEMS.register("wimpy_spell_book", () -> new SpellBook(0, SpellRarity.LEGENDARY, new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON)));

this is what i'm seeing in iron's spells

#

so they can have different rarities, but something is breaking it

wild verge
#

Is it possible that this just overrides the script somehow?

coarse light
#

oh shit hold on

#

raha this is an error on our side

wild verge
#

Is it doing the rarity before the mod does it?

coarse light
#

no, it's that the item properties set in the builder are used nowhere

wild verge
#

Oh yea that'll do it

coarse light
#

okay now i'm even more confused

#

the only type of spell book that lets you set item properties is the normal spell book

wild verge
#

The normal one? Like the wimpy one above?

coarse light
#

yeah

#

i'm going to ask iron about this

wild verge
#

Oh so does that mean that the wimpy spell book is literally used as a reference for more than just model and texture?

coarse light
#

but right now i need to go, so i'll check this tomorrow

wild verge
#

Alright sounds good

coarse light
verbal solstice
#

@coarse light I remember I didn't include rarity change because Iron hardcoded rarity, at least on one of the versions we were using at the time

verbal solstice
#

or was it the spell rarity? hmmm

coarse light
verbal solstice
#

yeah

coarse light
#

Oh wait I misread

verbal solstice
#

also be careful with ItemBuilder, you need to override some that does not apply

coarse light
#

Hm

verbal solstice
#

and need to check if models are like normal item and not some cursed path like the school and scrolls stuff

#

model/texture path*

coarse light