This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
I'm making a villager trade where you can upgrade sword to a better sword with an "Iron Coin"
when i buy it and then try to buy the next i can't even though they have the same tag.
command:
/summon villager ~ ~2 ~ {Silent:1b,Invulnerable:1b,CustomNameVisible:1b,PersistenceRequired:1b,NoAI:1b,CanPickUpLoot:0b,Xp:0,CustomName:'[{"text":"Swords","color":"#696969","bold":true,"underlined":true},{"text":" #1","color":"gold","bold":false,"underlined":false}]',ArmorItems:[{},{},{},{id:'minecraft:player_head',Count:1b,tag:{SkullOwner:{Id:[I;-865041524,-1727705171,-2040559009,-2092760462],Properties:{textures:[{Value:'eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzFhOTQ2M2ZkM2M0MzNkNWUxZDlmZWM2ZDVkNGIwOWE4M2E5NzBiMGI3NGRkNTQ2Y2U2N2E3MzM0OGNhYWIifX19'}]}}}}],ArmorDropChances:[0.085F,0.085F,0.085F,0.085F],VillagerData:{level:99,profession:"minecraft:weaponsmith",type:"minecraft:taiga"},Offers:{Recipes:[{uses:99999999999,buy:{id:'minecraft:stone_sword',Count:1b},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Basic Sword","color":"gray"}',Lore:["{\"text\":\"5% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:1.05,Operation:1,UUID:[I;-2109046453,-1857926868,-1856221570,1199018599]}]}}},{uses:99999999999,buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Basic Sword","color":"gray"}',Lore:["{\"text\":\"5% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:1.05,Operation:1,UUID:[I;-2109046453,-1857926868,-1856221570,1199018599]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Amateur Sword","color":"gray"}',Lore:["{\"text\":\"10% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.10,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{uses:99999999999,buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Amateur Sword","color":"gray"}',Lore:["{\"text\":\"10% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.10,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Rookie Sword","color":"gray"}',Lore:["{\"text\":\"15% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.15,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Rookie Sword","color":"gray"}',Lore:["{\"text\":\"15% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.15,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Apprentice Sword","color":"gray"}',Lore:["{\"text\":\"20% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.20,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Apprentice Sword","color":"gray"}',Lore:["{\"text\":\"20% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.20,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Tenderfoot Sword","color":"gray"}',Lore:["{\"text\":\"25% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.25,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Tenderfoot Sword","color":"gray"}',Lore:["{\"text\":\"25% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.25,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Novice Sword","color":"gray"}',Lore:["{\"text\":\"30% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.30,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}}]}}
The command works. I was able to upgrade to every sword. Make sure to select the next tier sword from the list on the left side when trading.
Command block engineer // Developer // #TeamTrees
I think the reason for it not working for me is that i'm doing it on a server, but when i test it on singleplayer it works.
Do you know why it only works on singleplayer?
And thanks for the answer.
Check if command blocks are enabled in the server.properties file (located in the root directory of the server) and double-check all of your commands to make sure you didn't make a typo when writing them on the server. That's all I can think of.
I'm making a villager trade where you can upgrade sword to a better sword with an "Iron Coin"
when i buy it and then try to buy the next i can't even though they have the same tag.
command:
/summon villager ~ ~2 ~ {Silent:1b,Invulnerable:1b,CustomNameVisible:1b,PersistenceRequired:1b,NoAI:1b,CanPickUpLoot:0b,Xp:0,CustomName:'[{"text":"Swords","color":"#696969","bold":true,"underlined":true},{"text":" #1","color":"gold","bold":false,"underlined":false}]',ArmorItems:[{},{},{},{id:'minecraft:player_head',Count:1b,tag:{SkullOwner:{Id:[I;-865041524,-1727705171,-2040559009,-2092760462],Properties:{textures:[{Value:'eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzFhOTQ2M2ZkM2M0MzNkNWUxZDlmZWM2ZDVkNGIwOWE4M2E5NzBiMGI3NGRkNTQ2Y2U2N2E3MzM0OGNhYWIifX19'}]}}}}],ArmorDropChances:[0.085F,0.085F,0.085F,0.085F],VillagerData:{level:99,profession:"minecraft:weaponsmith",type:"minecraft:taiga"},Offers:{Recipes:[{uses:99999999999,buy:{id:'minecraft:stone_sword',Count:1b},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Basic Sword","color":"gray"}',Lore:["{\"text\":\"5% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:1.05,Operation:1,UUID:[I;-2109046453,-1857926868,-1856221570,1199018599]}]}}},{uses:99999999999,buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Basic Sword","color":"gray"}',Lore:["{\"text\":\"5% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:1.05,Operation:1,UUID:[I;-2109046453,-1857926868,-1856221570,1199018599]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Amateur Sword","color":"gray"}',Lore:["{\"text\":\"10% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.10,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{uses:99999999999,buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Amateur Sword","color":"gray"}',Lore:["{\"text\":\"10% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.10,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Rookie Sword","color":"gray"}',Lore:["{\"text\":\"15% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.15,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Rookie Sword","color":"gray"}',Lore:["{\"text\":\"15% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.15,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Apprentice Sword","color":"gray"}',Lore:["{\"text\":\"20% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.20,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Apprentice Sword","color":"gray"}',Lore:["{\"text\":\"20% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.20,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Tenderfoot Sword","color":"gray"}',Lore:["{\"text\":\"25% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.25,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}},{buy:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Tenderfoot Sword","color":"gray"}',Lore:["{\"text\":\"25% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.25,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}},buyB:{id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:'{"text":"Iron Coin","color":"white","bold":true,"italic":true}',Lore:['[{"text":"Used for ","color":"dark_gray"},{"text":"Normal","color":"dark_gray","bold":true},{"text":" Trading","color":"light_purple"}]']},IronCoin:1b}},sell:{id:'minecraft:stone_sword',Count:1b,tag:{display:{Name:'{"text":"Novice Sword","color":"gray"}',Lore:["{\"text\":\"30% Attack Damage\",\"color\":\"light_purple\"}"]},HideFlags:6,Unbreakable:1b,Sword:1b,AttributeModifiers:[{AttributeName:'generic.attack_damage',Name:'generic.attack_damage',Amount:0.30,Operation:1,UUID:[I;811843502,-1669444538,-2143223057,600387495]}]}}}]}}
The command works. I was able to upgrade to every sword. Make sure to select the next tier sword from the list on the left side when trading.
Command block engineer // Developer // #TeamTrees
I think the reason for it not working for me is that i'm doing it on a server, but when i test it on singleplayer it works.
Do you know why it only works on singleplayer?
And thanks for the answer.
Check if command blocks are enabled in the server.properties file (located in the root directory of the server) and double-check all of your commands to make sure you didn't make a typo when writing them on the server. That's all I can think of.
Command block engineer // Developer // #TeamTrees