#Rename potions
11 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
??renameItems
[Quote ➤](#archived-example-scripts message) A script to rename items, the proper way instead of that bad workaround using the lang file I kept telling people to use.
onEvent('client.generate_assets', event => {
const rename = (item, newName) => event.addLang(Item.of(item).item.getDescriptionId(), newName)
// rename mutton to BAAAAAAA
rename('minecraft:mutton', "BAAAAAAA")
// rename all items with e in their path to EEEEEEEEEEEE
Ingredient.of(/:.*e/).stacks.forEach(item => rename(item, "EEEEEEEEEEEE"))
})
Client script. Doesn't work for some items like potions because they use different lang keys.
Reloadable with F3 + T
here's what some existing look like
"item.minecraft.lingering_potion": "Lingering Potion",
"item.minecraft.lingering_potion.effect.awkward": "Awkward Lingering Potion",
"item.minecraft.lingering_potion.effect.empty": "Lingering Uncraftable Potion",
"item.minecraft.lingering_potion.effect.fire_resistance": "Lingering Potion of Fire Resistance",
"item.minecraft.potion": "Potion",
"item.minecraft.potion.effect.awkward": "Awkward Potion",
"item.minecraft.potion.effect.empty": "Uncraftable Potion",
"item.minecraft.potion.effect.fire_resistance": "Potion of Fire Resistance",
"item.minecraft.splash_potion": "Splash Potion",
"item.minecraft.splash_potion.effect.awkward": "Awkward Splash Potion",
"item.minecraft.splash_potion.effect.empty": "Splash Uncraftable Potion",
"item.minecraft.splash_potion.effect.fire_resistance": "Splash Potion of Fire Resistance",
So would I need to use the workaround through the lang file?
I mean if you want to rename them, then yes you need to overwrite the lang keys....
was just showing you the format you needed to rename them
Alright. Thanks for the reply
Ticket closed!
My script uses lang keys, it just automatically gets the lang key from the item name