#Renaming a mod

93 messages · Page 1 of 1 (latest)

ruby slate
#

I've added the items I need to the server. But I don't like that it's just KubeJS. I want to do something like this: <project name> -- KubeJS. Can you tell me how to implement this?

rough forgeBOT
#

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

green meteor
#

what like

#

change the kubejs to smth else?

#

so its "namespace:hafnium_pieces"

ruby slate
#

I'm just doing the project myself and this is the first time I've dealt with all this.

green meteor
#

could i see the item registry?

ruby slate
# green meteor could i see the item registry?

@green meteor

const pieces = [
'toxic_pieces',
'titan_pieces',
'wolfram_pieces',
'yellorium_pieces',
'osmium_pieces',
'barium_pieces',
'bismuth_pieces',
'cadmium_pieces',
'chromium_pieces',
'cobalt_pieces',
'germanium_pieces',
'hafnium_pieces',
'manganese_pieces',
'michail_pieces',
'molybdenum_pieces',
'neodymium_pieces',
'niobium_pieces',
'palladium_pieces',
'platin_pieces',
'polonium_pieces',
'spinel_pieces',
'strontium_pieces',
'thallium_pieces',
'vanadium_pieces',
'yttrium_pieces',
'zinc_pieces',
'zirconium_pieces',
'arsenic_pieces',
'gadolinium_pieces',
'magnesium_pieces'
];

StartupEvents.registry('item', event => {
for (const value of pieces) {
event.create(value)
.texture('exnihilosequentia:item/' + value)
.maxStackSize(64)
.tooltip('tooltip.exnihilo.' + value)
}
});

green meteor
#

so thats an item in the screenshot?

#

and you want to change the display name?

ruby slate
#

@green meteor I want to change this to the project name kubejs

green meteor
#

but what is that

#

is that a tab?

#

or the items name

ruby slate
#

@green meteor This is the name of the mod.
I'm from Ukraine, so I can't always be at the computer.

green meteor
#

i think i understand

#

try changing the event.create(value) to event.create('modid' + value)

ruby slate
#

Here is an example in jei on ae2

green meteor
#

thats what i do and it works for me

#

although i've never created items from an array before, but i may start doing that in the future

ruby slate
#

@green meteor Once the air raid alarm ends, I'll try and write how it goes.

green meteor
#

ah alr

#

good luck btw

ruby slate
#

@green meteor Thank you so much for your help! Arrays are very convenient for working. I initially did it separately, but then converted it to an array, and now it's much easier to navigate and make adjustments if necessary.

ruby slate
#

@green meteor I'll try and tell you the result.

ashen fern
#

@ruby slate something like this

ruby slate
#

@green meteor This method didn't work.

ruby slate
ashen fern
#

in startup script

high fiber
#

when adding the items, in the startup scripts I very simply add the modid I want as a prefix to the name and place the textures in that namespace.

StartupEvents.registry('item', event => { const additionsItems = [ 'kingdomsandcats:amethyst_dust' ] additionsItems.forEach(item => { event.create(item) }) })

here is an example, where the modid displays as 'kingdomsandcats' with the textures in kubejs/assets/kingdomsandcats/textures/item

this way you could potentially make any item you make have any modid you want with the caveat that you need to place it in the right location in your kubejs folder

what owen said also works, as an axample here is the above but using the formating that owen suggested just in case it wasnt made clear enough

const additionsItems = [ 'amethyst_dust' ] additionsItems.forEach(item => { event.create('kingdomsandcats:' + item) })

#

with either method the result is identical

ruby slate
# high fiber when adding the items, in the startup scripts I very simply add the modid I want...

Thank you so much! Help me fix my array code. Because now, after all this anxiety, I can't figure out where and what to insert.

const pieces = [
'toxic_pieces',
'titan_pieces',
'wolfram_pieces',
'yellorium_pieces',
'osmium_pieces',
'barium_pieces',
'bismuth_pieces',
'cadmium_pieces',
'chromium_pieces',
'cobalt_pieces',
'germanium_pieces',
'hafnium_pieces',
'manganese_pieces',
'michail_pieces',
'molybdenum_pieces',
'neodymium_pieces',
'niobium_pieces',
'palladium_pieces',
'platin_pieces',
'polonium_pieces',
'spinel_pieces',
'strontium_pieces',
'thallium_pieces',
'vanadium_pieces',
'yttrium_pieces',
'zinc_pieces',
'zirconium_pieces',
'arsenic_pieces',
'gadolinium_pieces',
'magnesium_pieces'
];

StartupEvents.registry('item', event => {
for (const value of pieces) {
event.create(value)
.texture('exnihilosequentia:item/' + value)
.maxStackSize(64)
.tooltip('tooltip.exnihilo.' + value)
}
});

high fiber
#

if you replace kingdomsandcats: everywhere it appears with whatever modid you want to display and put your items in place of amethyst_dust you'll be golden

#

if youre afraid to touch it, create a copy of the file on your desktop before you make changes and test stuff out

#

since you did an array already, instead of fixing the array use the method

event.create('kingdomsandcats:' + item)

but with your modid in the place of 'kingdomsandcats:'

#

also post scripts between two of these symbols > ` (backtick)

#

it makes it cleaner and easier to copy/paste

vagrant nexus
high fiber
#

im not 100% sure it works with custom modids but if you use the standard kubejs modid or swap kubejs for an existing modid, you can change that blue tag with this
Platform.mods.kubejs.name = 'Your Name Here'

#

I havent done this myself except when I tried it out while testing what I wanted to do for my own packs

#

oops didnt reply so ill @vagrant nexus

vagrant nexus
#

unfortunately

high fiber
#

try with leaving kubejs as the modid, just to see if thats the issue or not

vagrant nexus
#

my other items have a custom blue display name

#

no then it will just change the ones with kubejs item id

#

the ones that have the custom modid will not be changed

high fiber
#

right, thats what im meaning

#

not using custom modid

#

as said im not sure you can do that layered with custom modids

vagrant nexus
#

no worries, i'll just use the standard kubejs modid

high fiber
#

if anyone more experienced than me knows of a way to do both @ me if you answer it pls ❤️

ruby slate
#

None of the methods worked. Every time I see this result in the server console.

hearty coyoteBOT
#

Paste version of message.txt from @ruby slate

ruby slate
#

Even because of the air raid alarm I can't concentrate on the matter.

high fiber
#

send script between backticks whenever you got updates pls

#

ofc when you get time

ruby slate
#

`
const pieces = [
'toxic_pieces',
'titan_pieces',
'wolfram_pieces',
'yellorium_pieces',
'osmium_pieces',
'barium_pieces',
'bismuth_pieces',
'cadmium_pieces',
'chromium_pieces',
'cobalt_pieces',
'germanium_pieces',
'hafnium_pieces',
'manganese_pieces',
'michail_pieces',
'molybdenum_pieces',
'neodymium_pieces',
'niobium_pieces',
'palladium_pieces',
'platin_pieces',
'polonium_pieces',
'spinel_pieces',
'strontium_pieces',
'thallium_pieces',
'vanadium_pieces',
'yttrium_pieces',
'zinc_pieces',
'zirconium_pieces',
'arsenic_pieces',
'gadolinium_pieces',
'magnesium_pieces'
];

StartupEvents.registry('item', event => {
const modid = 'paradisemcexnihiloadd';

for (const value of pieces) {
event.create(${modid}:${value})
.texture(${modid}:item/${value})
.maxStackSize(64)
.tooltip(tooltip.kubejs.${value});
}
});
`

This is what my code looks like now.

ruby slate
#

nothing has changed for me

brave shoal
#

the solution I had was simply changing the kubejs name and not worrying about the namespace:

// priority: 0

//MARK: Hello!
console.info(
    "Hello, World! (You will only see this line once in console, during startup)"
);

// Renamed kjs to Cottage Witch
Platform.mods.kubejs.name = "Cottage Witch";
Platform.mods.ae2.name = "Arcane Enigmatics 2";
Platform.mods.minecraft.name = "Minceraft";

/**
 *
 * MARK: -ITEMS
 *
 */

StartupEvents.registry("item", (event) => {
high fiber
#

are you writing the code with AI?

#

@ruby slate

high fiber
#

it got buried but to show it again here is how to format it without needing to alter your array
` StartupEvents.registry('item', event => {
const testItems = [
'your_item'
]

testItems.forEach(item => {
    event.create('yourmodid:' + item)
})

})`

high fiber
brave shoal
#

yeah I was trying to show how to do it cos it seemed they were doing it in some broken way lol

#

the only issue is that if you give the items a custom mod name you can't rename that mod's display name since it doesn't exist

high fiber
#

ok cool, I didnt know if that was actually the case or if I just didnt know

#

ty ❤️

ruby slate
ruby slate
#

By the way, yes, your method didn't work for me, neither on the server nor in singleplayer.

ruby slate
#

The most interesting thing is that he found the necessary text himself, but he couldn’t find the lang in Ukrainian.

ruby slate
green meteor
#

im pretty sure thats the creative tab

#

meaning you need to change the creative tab

round umbra
#

Indeed you need to remove the item from the base KubeJS tab, the id for this tab is kubejs:tab, and then you need to add that item to your own custom creative tab

#
event.remove('modid:my_item')
})

 StartupEvents.registry('creative_mode_tab', event => {
    event.create('newtab').icon(() => 'minecraft:diamond_pickaxe').content(() => [
        'modid:my_item'
    ])
})

 StartupEvents.modifyCreativeTab('kubejs:newtab', event => {
  event.displayName = 'My Super Duper Modid Awesome'
 })```
brave shoal
ruby slate
ruby slate
brave shoal
#

Basically what's happened is:

  • you renamed kubeJS' mod name to the correct thing
  • you added a bunch of items under a different mod name
  • the kubejs name change only applies to kubejs: items
  • if you remove modid from the item registry it should fix
ruby slate
# brave shoal Basically what's happened is: - you renamed kubeJS' mod name to the correct thin...

`Platform.mods.kubejs.name = "ParadiseMC-ExNihiloAddon";

StartupEvents.modifyCreativeTab('kubejs:tab', event => {
event.remove('paradisemcexnihiloadd:test_item')
})

StartupEvents.registry('creative_mode_tab', event => {
event.create('newtab').icon(() => 'minecraft:diamond_pickaxe').content(() => [
'paradisemcexnihiloadd:test_item'
])
})

StartupEvents.modifyCreativeTab('kubejs:newtab', event => {
event.displayName = 'ParadiseMC-ExNihiloAddon'
})

StartupEvents.registry("item", (event) => {
const testItems = [
'test_item'
]

testItems.forEach(item => {
event.create ('paradisemcexnihiloadd:' + item)
})
})`

My code looks like this now. Please help me edit it. I would be very grateful.

brave shoal
#

Since the players are most likely to be playing in survival, they probably don't need to worry about the creative mode tabs so i removed that part.

I also then swapped event.create('paradisemcexnihiloadd:' + item) for event.create(item) as that was causing the incorrect name:

Platform.mods.kubejs.name = "ParadiseMC-ExNihiloAddon";

StartupEvents.registry("item", (event) => {
  const testItems = [
    'test_item'
  ]

  testItems.forEach(item => {
    event.create(item)
  })
})```

This will result in the item `kubejs:test_item` but the blue display name will be **ParadiseMC-ExNihiloAddon**, which is what I think you wanted to get as a result right?
#

Basically the only thing you need, if you want to change the blue name, is

Platform.mods.kubejs.name = "ParadiseMC-ExNihiloAddon";

and then create items normally after that point

ruby slate
#

@brave shoal I have an active air defense system running here right now, so I can't concentrate yet. But as far as I understand, this is exactly what I wanted, except for kubeJS:test_item. I wanted it to be paradisemcexnihiloadd:test_item.

#

and I won't have 1 item in the array, but 30

brave shoal
#

Unfortunately I don't think there's an easy way to have both -
You can either change the name of KubeJS (but keep the modid) which gives the blue name
Or you can add the mod id you want, but the display name is stuck in the format it is. since it doesn't actually exist you can't change it

Personally i think having the blue name is good even without the mod id