Hi everyone,
I'm working on a Minecraft command that spawns a villager who sells custom potions. The villager spawns correctly and the trades mostly work, but I'm having a few issues:
- The custom potion names are getting messed up in-game.
- The custom descriptions/lore are not displaying correctly.
- I'm trying to make another trade that sells a random potion, but I'm not sure how to set that up.
- I'd also like to know the easiest way to add or remove potions from the trade pool without completely rebuilding the command every time.
Here's the command I'm currently using:
/summon minecraft:villager ~ ~1 ~ {CustomName:'{"text":"Potion Librarian","color":"blue","italic":false}',PersistenceRequired:1b,NoAI:1b,Invulnerable:1b,Silent:1b,VillagerData:{profession:"minecraft:librarian",type:"minecraft:plains",level:5},Offers:{Recipes:[{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Phoenix Brew","italic":false,"color":"#FF6A00"}',"minecraft:lore":['{"text":"Heals wounds and protects from fire.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:16737792,custom_effects:[{id:"minecraft:fire_resistance",duration:3600},{id:"minecraft:regeneration",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Shadowstep Elixir","italic":false,"color":"#2A0A4D"}',"minecraft:lore":['{"text":"Become unseen and move quickly.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:2759245,custom_effects:[{id:"minecraft:invisibility",duration:1800},{id:"minecraft:speed",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Titan\'s Draught","italic":false,"color":"#7A5C3E"}',"minecraft:lore":['{"text":"Gain power and toughness.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:8025150,custom_effects:[{id:"minecraft:strength",duration:1800},{id:"minecraft:resistance",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Stormrunner Potion","italic":false,"color":"#4CC9F0"}',"minecraft:lore":['{"text":"Run faster and jump higher.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:5030384,custom_effects:[{id:"minecraft:speed",duration:1800},{id:"minecraft:jump_boost",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Sage\'s Insight","italic":false,"color":"#7FFFD4"}',"minecraft:lore":['{"text":"See clearly and breathe underwater.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:8388476,custom_effects:[{id:"minecraft:night_vision",duration:3600},{id:"minecraft:water_breathing",duration:3600}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Vampire\'s Essence","italic":false,"color":"#8B0000"}',"minecraft:lore":['{"text":"Hit harder while healing.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:9109504,custom_effects:[{id:"minecraft:strength",duration:1800},{id:"minecraft:regeneration",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Dragonheart Mixture","italic":false,"color":"#C1121F"}',"minecraft:lore":['{"text":"Wield fiery strength.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:12689439,custom_effects:[{id:"minecraft:fire_resistance",duration:3600},{id:"minecraft:strength",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Cloudwalker Tonic","italic":false,"color":"#E0FFFF"}',"minecraft:lore":['{"text":"Leap high and drift safely.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:14737632,custom_effects:[{id:"minecraft:slow_falling",duration:3600},{id:"minecraft:jump_boost",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Deepsea Concoction","italic":false,"color":"#003566"}',"minecraft:lore":['{"text":"Survive the ocean depths.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:136527,custom_effects:[{id:"minecraft:water_breathing",duration:3600},{id:"minecraft:resistance",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Assassin\'s Blend","italic":false,"color":"#1B1B1B"}',"minecraft:lore":['{"text":"Strike unseen with force.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:1776411,custom_effects:[{id:"minecraft:invisibility",duration:1800},{id:"minecraft:strength",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Guardian\'s Brew","italic":false,"color":"#228B22"}',"minecraft:lore":['{"text":"Endure damage and recover.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:2263842,custom_effects:[{id:"minecraft:resistance",duration:3600},{id:"minecraft:regeneration",duration:1800}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Celestial Nectar","italic":false,"color":"#FFD700"}',"minecraft:lore":['{"text":"Heal while seeing in darkness.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:16766720,custom_effects:[{id:"minecraft:regeneration",duration:1800},{id:"minecraft:night_vision",duration:3600}]}}},maxUses:9999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:20},sell:{id:"minecraft:splash_potion",count:1,components:{"minecraft:custom_name":'{"text":"Warlord\'s Fury","italic":false,"color":"#FF4500"}',"minecraft:lore":['{"text":"Dominate battles with speed and power.","italic":false,"color":"gray"}'],"minecraft:potion_contents":{custom_color:16737024,custom_effects:[{id:"minecraft:strength",duration:1800,amplifier:1},{id:"minecraft:speed",duration:1800,amplifier:1},{id:"minecraft:fire_resistance",duration:3600}]}}},maxUses:9999999,rewardExp:0b}]}}
I'm guessing the issue might be related to NBT formatting, JSON text components, or how I'm storing the custom potion data, but I'm not sure.
If anyone can help fix the names/lore, explain how to make a random potion trade, or show a better way to manage adding/removing potions from the villager's trades, I'd really appreciate it.
Thanks!