crazysnailboy / VillagerTrades

A minecraft mod to manipulate villager trades using JSON files
MIT License
5 stars 6 forks source link

Certain villagers not working. #13

Closed Supermatt5546 closed 7 years ago

Supermatt5546 commented 7 years ago

The cleric isn't trading any more for some reason, & neither do the nitwit, nor the tinkerer work either, & I added trades similar to the ones here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2789932-villager-trade-tables. The butcher is also not trading anything different than he does from the base game.

crazysnailboy commented 7 years ago

Please post your custom trade files to PasteBin and link them here so that I can take a look. Also, what version of Minecraft are you using?

Supermatt5546 commented 7 years ago

Thank you for replying as quickly as you did. I got the butcher to sell cooked chicken, but nothing else new. Here: https://pastebin.com/He2YNmVT I'm using 1.12. I also tried to make the tinker a type of redstoner, & replace the original tinker with a dyer, but that didn't go well. I also tried fiddling with the chance to see if that would make the butcher trade what I wanted him to, but nothing seemed to change. I haven't seen the paleontologist or the dyer show up either.

Supermatt5546 commented 7 years ago

I also wanted to change the base game trades to be more appropriate in price, with nuggets being the lowest(maybe iron nuggets for dirt cheap stuff), gold ingots being in the middle, & emeralds & gold blocks being for the most expensive stuff. I didn't fiddle with that because I don't have a list of all the base game trades.

crazysnailboy commented 7 years ago

There were a few different errors in those files. I've fixed them up, and these should work:

Supermatt5546.zip

I've included a a summary of what I changed below. Let me know if you run into any more problems :)


When adding a recipe into a trade file, all of the recipes except the final one should have a comma after the final curly brace. In your paleontologist for example, you had:

{action:"add", buy:{id:"minecraft:bone",Count:{min:15,max:19}},sell:{id:"minecraft:gold_nugget",Count:1},CareerLevel:1}
{action:"add", buy:{id:"minecraft:bone_block",Count:{min:5,max:10}},sell:{id:"minecraft:emerald",Count:1},CareerLevel:2}

which should be

{action:"add", buy:{id:"minecraft:bone",Count:{min:15,max:19}},sell:{id:"minecraft:gold_nugget",Count:1},CareerLevel:1},
{action:"add", buy:{id:"minecraft:bone_block",Count:{min:5,max:10}},sell:{id:"minecraft:emerald",Count:1},CareerLevel:2}

The names of the villager professions should be lower case as well, so in the instance of the paleontologist, "minecraft:Librarian" should be "minecraft:librarian"

There are also a few places - in the shepherd trade file, for example - where the number of curly braces isn't balanced - you have more opening than closing or the other way round.

Your leatherworker file has item names from Natura like "Natura:natura.armor.imphelmet", the mod id should be lower cased as Forge started to enforce that from v1.11. So that should be "natura:natura.armor.imphelmet" (assuming that the item name is correct). There was also "natura:barleyFood:3" which I assume should be "natura:barleyFood.3".

Your butcher file has a few period that should be commas, e.g.:

{action:"add", buy:{id:"minecraft:gold_nugget",Count:25},sell:{id:"minecraft:cooked_rabbit",Count:{min:6,max:8}}, CareerLevel:2.chance:1}
{action:"add", buy:{id:"minecraft:gold_nugget",Count:25},sell:{id:"minecraft:cooked_rabbit",Count:{min:6,max:8}}, CareerLevel:2,chance:1}

As an aside, you don't need to specify the chance if you always want that trade to occur, so a chance value of 1 is unnecesssary.

Your dyer file references a new career on the nitwit, and your paleontologist file references a new career for the librarian, but you've not included villager files which adds those careers. Did you forget to upload those?

Your dyer file doesn't include an action or a career level for the second trade.

Supermatt5546 commented 7 years ago

The Natura IDs were how they appeared on the FTB wiki. Didn't expect that it would be so picky about lower or uppercase. I know the chance values were not needed, I just tried fiddling with them because I had no other idea, & when I saw that it didn't work, I removed it from some of the files, but forgot to remove them all obviously. I didn't because I didn't know what I was doing, simply put. I mentioned before that I tried to turn the tinkerer into a redstoner career & replace the tinkerer villager file with a dyer one, using the same textures as the old tinker, but again, I couldn't get it to work correctly. Thank you very much for your help, I'll let you know if I encounter problems again.

crazysnailboy commented 7 years ago

The FTB wiki probably hasn't been updated in a while. Unfortunately Minecraft itself is now very picky about upper and lower case - they renamed everything to make it lower case in 1.11 I believe.

Check out the wiki page for adding new professions and careers if you're still having trouble making that work, and if you've got any more questions I'll do my best to answer them :)

Supermatt5546 commented 7 years ago

Yeah, I noticed that some time ago, but I was crossing my fingers that the IDs weren't changed. That's a bit annoying, but not too bad I suppose. I was looking at the wiki before I even tried messing with the files. Ok, thanks again.

Supermatt5546 commented 7 years ago

I decided to tweak the dyer: https://pastebin.com/2KuFQj0G That look correct? I tend to have trouble dealing with text & symbols, so I tend to mess this kind of stuff up. I'm also thinking about clearing most of the NPCs to change the values of their trades & add an addition to the farmer(a baker) & to the tinkerer(an explosives merchant that deals with tnt, barrels of gunpowder, & fireworks). The farmer shouldn't be a problem with me for the most part, but the explosives guy will be a pain due to the firework stars(like flowers & dye) using different values rather than different name IDs.

Supermatt5546 commented 7 years ago

I'm also confused on how I should go about making their villager files. Do I make a baker one like you did with dyer, or a farmer one with baker under "careers" like you did with librarian & priest?

crazysnailboy commented 7 years ago

On the first two trades in your new dyer file you're missing a value for career level, you need an additional closing bracket after the buy count, and a comma before the buy and sell elements on both.


{
    Profession:"minecraft:nitwit", Career:"dyer",
    Offers:{
        Recipes:[
            {action:"add", CareerLevel:1, buy:{id:"minecraft:red_flower",Damage:0,Count:{min:15,max:20}}, sell:{id:"minecraft:gold_nugget",Count:{min:25,max:30}}},
            {action:"add", CareerLevel:1, buy:{id:"minecraft:cactus",Count:{min:15,max:20}}, sell:{id:"minecraft:gold_nugget",Count:{min:25,max:30}}},
            {action:"add", CareerLevel:2, buy:{id:"minecraft:gold_nugget",Count:{min:25,max:30}},sell:{id:"minecraft:dye",Damage:1,Count:{min:15,max:20}}},
            {action:"add", CareerLevel:2, buy:{id:"minecraft:gold_nugget",Count:{min:25,max:30}},sell:{id:"minecraft:dye",Damage:2,Count:{min:15,max:20}}}
        ]
    }
}```
crazysnailboy commented 7 years ago

I'm not sure I understand the question on the villager files. If you're adding careers to an existing profession, you just specify the profession name and the careers like I did in the dyer file. If you're creating a new profession, you also need to provide the paths to the texture and the zombie texture like I did in my brewer file.

If you want to replace my tinkerer with a dyer you can copy that file directly and just change the name of the profession and the career:

{
    profession: {
        name: "vtt:dyer",
        texture: "vtt:textures/entity/villager/tinkerer.png",
        zombieTexture: "vtt:textures/entity/zombie_villager/zombie_tinkerer.png"
    },
    careers: [
        "dyer"
    ]
}
Supermatt5546 commented 7 years ago

I was confused on the dyer file not being named nitwit, like the one for the necromancer was under "priest". I take it the name of the file doesn't matter, as long as the contents of the file are as you laid them out? Because if I want to make the dyer(perhaps as a career under a new "merchant" profession) replace tinkerer, I'd want to take the old tinkerer trades & apply it to a new "redstone tinkerer" career for the redstoner profession.

Supermatt5546 commented 7 years ago

Also the corn ,barley, & cotton don't show up on the farmer, although what I set him to give you for them does, funny enough. The paleontologist's name shows up on the damage indicator mod as entity.villager.paleontologist or something like that. His trading seems to work at least. I also tried what you said about the dyer, but changing the profession in both the tables & the files but he just gets entity.villager.dyer & won't trade. He did this whether the profession was named dyer or merchant. This was what I was refering to when I said it didn't go well last time I replaced the tinker with the dyer, & when I try to make a new career called "redstone tinkerer" with it's own file with the profession being the redstoner(along with changing the tinker table to the redstone tinkerer table) it causes my game to crash during loading. Here's the files: https://pastebin.com/eqsRgAmr

crazysnailboy commented 7 years ago

If you want to change the name for the career that you see in trading GUI, you'll need to use a resource pack or the Resource Loader mod to load an additional language file. I've got a sample resource pack you can modify here:

VTT Sample Resource Pack (1.11.x - 1.12.x).zip

crazysnailboy commented 7 years ago

In Natura 1.12, barley is called "materials" and has a metadata value of 0, and cotton is also called "materials" and has a metadata of 3. So you'll need something like:

{action:"add", buy:{id:"natura:materials",Damage:3,Count:20},sell:{id:"minecraft:gold_nugget",Count:{min:15, max:19}}, CareerLevel:1,chance:1}

to make the villager buy cotton.

You can see the names and metadata values in Minecraft if you press F3+H.

Supermatt5546 commented 7 years ago

Again, thank you. Also the funny thing is, I tried to see if the id was what the wiki said it was, but instead of ":3" I changed it to "damage:3" & it undid the "clear" action, which I found to be quite odd. Now to go through who knows how many more testificates/villagers to find out what other damage values give me & see if it's similar to the simple corn mod. Oh, I forgot to mention that when I replaced the tinker files with the dyer like you said, the regular tinker still can spawn, but they do nothing.

Supermatt5546 commented 7 years ago

Oh, didn't see the F3+H tip. That will be very helpful. Thank you very much.

crazysnailboy commented 7 years ago

In the mod's config (vtt.cfg in the config folder), if you set "loadVillagersFromJar" to false the built-in villagers will no longer spawn.

Supermatt5546 commented 7 years ago

Interesting, but I'm not sure I understand. Would that disable NPCs like the farmer entirely or just the ones without custom files? I'm not sure I understand the purpose of that, other than to test out the tinkerer(who still isn't trading for some reason like the dyer) if it's the former.

Supermatt5546 commented 7 years ago

The farmer stopped working & I don't know why. He either has no custom trades, or I can't trade with him at all.

{
    Profession:"minecraft:farmer",
    Career:"farmer",

    Offers:{
        Recipes:[
            {action:"clear"},
            {action:"add", buy:{id:"minecraft:beetroot",Count:{min:15,max:19}},sell:{id:"minecraft:gold_nugget",Count:30}, CareerLevel:1},
            {action:"add", buy:{id:"minecraft:wheat",Count:{min:15,max:19}},sell:{id:"minecraft:gold_nugget",Count:30}, CareerLevel:1},
            {action:"add", buy:{id:"minecraft:potato",Count:{min:15,max:19}},sell:{id:"minecraft:gold_nugget",Count:30}, CareerLevel:1},
            {action:"add", buy:{id:"minecraft:carrot",Count:{min:15,max:19}},sell:{id:"minecraft:gold_nugget",Count:30}, CareerLevel:1},
            {action:"add", buy:{id:"natura:materials",Damage:0,Count:20},sell:{id:"minecraft:gold_nugget",Count:{min:15, max:19}}, CareerLevel:1}
            {action:"add", buy:{id:"natura:materials",Damage:3,Count:20},sell:{id:"minecraft:gold_nugget",Count:{min:15, max:19}}, CareerLevel:1}
            {action:"add", buy:{id:"simplecorn:corncob",Count:{min:15,max:19}},sell:{id:"minecraft:gold_nugget",Count:25}, CareerLevel:1,}
            {action:"add", buy:{id:"minecraft:gold_nugget",Count:{min:15,max:19}},sell:{id:"natura:materials",Damage:1,Count:10}, CareerLevel:2},
            {action:"add", buy:{id:"minecraft:gold_nugget",Count:{min:15,max:19}},sell:{id:"natura:materials",Damage:2,Count:10}, CareerLevel:2},
            {action:"add", buy:{id:"minecraft:gold_nugget",Count:{min:15,max:19}},sell:{id:"simplecorn:roastedcorn",Count:5}, CareerLevel:2},
            {action:"add", buy:{id:"minecraft:gold_nugget",Count:{min:16, max:20}},sell:{id:"minecraft:egg",Count:5}, CareerLevel:3}
        ]
    }
}
crazysnailboy commented 7 years ago

If you look at the end of each recipe row, you'll see that some of the rows end with commas and some don't, and that on one you've put the comma before the final brace instead of after it. They all need commas at the end except the final one.

Supermatt5546 commented 7 years ago

Yeah, I caught that after I made the post, was going to make a comment before you saw it, but oh well. Not sure how I screwed that up, but oh well.

crazysnailboy commented 7 years ago

Do you need any more help with your custom tables or can I close this ticket?

Supermatt5546 commented 7 years ago

It will take me a little bit to make my final draft for my custom tables.