Started by
BetaDv_
on
Topic category: Help with Minecraft modding (Java Edition)
How could I make a villager with a Proffesion: "Scammer", what he does, is setup fake trades, and whenever the user trades, he gets nothing in Exchange, and just gets scammed overall. I know I can make a gui and all that, but if I could use the default gui so it looks credible, and make it spawn in villages it would be best, if anyone has any idea how I could get this done (even if it involves code) I would really apreciate if you could help me! :)
Just use default vanilla gui and apply it
In trade you can get something like AIR
Make villagers spawn in villages with return conditions
like woodcreatures said, just make a new villager with the exact same texture and download the GUI from Google or .minecraft folder and use this: MCreator Tutorial: How to make NPC Trades | 2020.3 - YouTube
a workaround could be with commands, by summoning a Vanilla Villager with a custom trade Minecraft 1.16.4: How to make a custom villager trades - Bing video however I don't think this is a good option
Well.. you can make custom professions and trades for villagers, there is even registry for that.
This feature is going to be in MCreator in future.
But you can make it right now with coding.
I can explain this too you and even provide example(from my mod).
I'd love if you could help me do this, Frostygames. Any time you are available, could you send me the code and stuff?
Sure, here: https://github.com/Frostygames0/Elemental-Amulets/blob/master/src/main/java/frostygames0/elementalamulets/init/ModVillagers.java
This is how to register villagers. Use register method in the constructor of your main class.
Also, anything lower than registerWandererTrades is not needed.
To give your villager a working outfit: https://github.com/Frostygames0/Elemental-Amulets/tree/master/src/main/resources/assets/elementalamulets/textures/entity
Also a small note: if you copy the code, then the license of your mod should be GPL v3 or any compatible license and not “all rights reserved”
Hey, I understand how this code works, but doesn't this actually give me the item? I want it to not give anything back xd
If you want it to return empty item then use ItemStack.EMPTY in BasicTrade's constructor instead of new ItemStack(Item instance).
Or you can create your own trade class.
Well yes, but wouldn't work as I intended. I want to show the item, but when the user goes to take it, it removes it and it takes his emeralds and stuff
That's at least what I think it will do
I have a question. Since I don't know any bit of Java really, only Javascript, which is very different. Could you explain to me a bit how to port this to my mod? If it helps my package name is:
me.betadv.better_vanilla
Thx in Advance, you are nice! :)
1.Replace YOUR MOD ID with your mod id, also call your file as ScammerVillager
2.Call register method in your mod constructor like that: ScammerVillager.register()
3. That should be all
YOO, thanks so much man! You are so good! This has worked for me!
NP, if you have any questions just ask!