#Rename potions

11 messages · Page 1 of 1 (latest)

vast vale
#

So I know Chief had created a script to rename items (quoted below) but can you apply it to NBT related things like potions? I really would just like to change out the word "potion" with a more immersive word for my pack

steel prismBOT
#

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

vast vale
#

??renameItems

errant onyxBOT
#

[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

zealous mural
#

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",
vast vale
#

So would I need to use the workaround through the lang file?

zealous mural
#

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

vast vale
#

Alright. Thanks for the reply

topaz chasm
#

My script uses lang keys, it just automatically gets the lang key from the item name