#Renaming a mod
93 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
I need to change the blue KubeJS to <my project name> KubeJS
I'm just doing the project myself and this is the first time I've dealt with all this.
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 I want to change this to the project name kubejs
@green meteor This is the name of the mod.
I'm from Ukraine, so I can't always be at the computer.
i think i understand
try changing the event.create(value) to event.create('modid' + value)
Here is an example in jei on ae2
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
@green meteor Once the air raid alarm ends, I'll try and write how it goes.
@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.
@green meteor I'll try and tell you the result.
@green meteor This method didn't work.
Where should I enter this? I posted the code above.
in startup script
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
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)
}
});
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
hey im trying this out its really awesome, do you know how i can change the name of the blue displayed name
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
i tried that one and it crashed the game
unfortunately
try with leaving kubejs as the modid, just to see if thats the issue or not
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
right, thats what im meaning
not using custom modid
as said im not sure you can do that layered with custom modids
no worries, i'll just use the standard kubejs modid
if anyone more experienced than me knows of a way to do both @ me if you answer it pls ❤️
None of the methods worked. Every time I see this result in the server console.
Paste version of message.txt from @ruby slate
Even because of the air raid alarm I can't concentrate on the matter.
`
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.
nothing has changed for me
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) => {
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)
})
})`
and this is another option that was mentioned above
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
I wrote it myself. I was looking for a solution through AI
Who did it the wrong way? If you're so smart, write me a complete code that will run the first time. I'll send you the source code and everything else.
By the way, yes, your method didn't work for me, neither on the server nor in singleplayer.
I did it like this, but the result is still the same.
Here is the code and result
The most interesting thing is that he found the necessary text himself, but he couldn’t find the lang in Ukrainian.
I wrote this code completely myself. The result is the same.
im pretty sure thats the creative tab
meaning you need to change the creative tab
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'
})```
Put the item in your inventory and then hover over it from there in survival mode
It works, but only in Creative. How can I get the same name in Survival?
It works. But I need it to say ParadiseMC-ExNihiloAddons in Survival.
The command Platform.mods.kubejs.name = "ParadiseMC-ExNihiloAddon"; didn't help.
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
`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.
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
@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
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