KubeJS

KubeJS

69M Downloads

Changing mod display name not working

TheStaticVoid opened this issue ยท 4 comments

commented

Minecraft Version

1.19.2

KubeJS Version

1902.6.0-build.142

Rhino Version

1902.2.2-build.268

Architectury Version

6.5.77

Forge/Fabric Version

Fabric 0.14.19

Describe your issue

The mod display renaming in the documentation here does not appear to be working for me. Here's my startup script:

Platform.mods.kubejs.name = 'My Modpack Name';

StartupEvents.registry('item', e => {
    e.create('example_item').displayName('Example');
});

Modlist:

  • Architectury v6.5.77
  • Cloth Config v8.2.88
  • Fabric API 0.76.0+1.19.2
  • KubeJS 1902.6.0-build.142
  • Rhino 1902.2.2-build.268
  • Roughly Enough Items 9.1.595

What I see in REI:
image

Crash report/logs

latest.log

commented

It seems to be working fine with other mods, and kubejs standard, but cannot be used to redefine custom names for kubejs-created custom items.

TypeError: Cannot set property "name" of undefined to "Geghilarity"

Of course you can set the name to what you want, already, but I wanted to use this so that I could do proper capitalization on the first letter, or deal with spaces as well.

commented

That is because to change the name associated with a modid, a mod needs to exist for that modid.
Just specifying a custom namespace when adding something doesnt create a mod.

commented

I moved it down the file, but it didn't change much.

I guess it depends when these things are set up.

commented

Where it is in the file doesn't matter. At no point (currently) will KubeJS just create a virtual mod, which would be what is required to change the name of a custom namespace that doesnt belong to an existing mod.

If you look at what the code is doing, it is getting a list of mods, getting a mod from that list, then changing properties for that mod. The error you got is saying that the mod you specified doesn't exist.