Let’s add some custom villagers to minecraft all right we found ourselves back intelligence more and in this tutorial we’re going to be adding a custom villagers to minecraft now this has actually changed in 119 compared to 1 18 so let’s just jump in and see what we Can do so in our tutorial mode package we’re going to right-click a new package called a villager and then instead of there we’re going to make one new class and that’s going to be the mod villagers class now first and foremost we need three different methods here the first One is going to be the public static void or register villagers method and that is going to do the following it’s going to say tutorial mod dot logger dot a debug and then just saying registering villagers or and then tutorial mod dot mod id and then we’ll immediately call this in the tutorial Mod class over here so modvillagers.registervillagers and this is once again needed even though it only outputs this particular thing this is needed so that the static fields that we’re going to introduce in just a moment are properly initialized otherwise they won’t load properly this is why we need this even though it Doesn’t do anything or it looks like it only outputs something it actually does a little bit more this is just some java weirdness in this case now the second method that we’re going to need is the public static point of interest type this is very important that we use this One right here from net micro world poi so just tap to auto complete and we’re going to call this the register poi method this takes in a string parameter called name and a block parameter called block now let’s actually go here alt and enter to import this net minecraft block There we go and here we want to return point of interest type helper this one right here from fabric api dot register with a new identifier passing in tutorial mod mod id comma name and then after the first closing parenthesis we’re going to add one then we’re gonna make an immutable Set that copy of there we go and then we’re gonna say block.getstatemanager.getstates and then three closing parentheses and that is it now this might look absolutely insane what does this do well our villager needs a point of interest where it can get a job from and this basically registers this particular Point of interest with the block that we’re passing in here and it’s going to make sure that every state that this block can take is actually registered properly because of course we’ve seen this previously right in the example of the tanzanite lamp block for example if We were to make this our point of interest then the boolean property here could be lit true or lit false but we want either one of those to be a point of interest for our villagers that’s the general idea here and then the ticket count just means how many villagers can Actually work at that point of interest and then search distance just as the distance basically that the villager will search for this now we also need to add a villager profession so this is going to be a public static villager profession this one right here register Profession it’s also going to take in a string name parameter and then it’s also going to take in a registry key of type point of interest type this one right here called type and this one looks a little bit crazier but we’re going to be fine so this is going to return Registry.register once again making sure that you choose the correct registry class here from net you minecraft util registry registry not the one from java very important and here we’re going to say registry you can see this one would be the wrong one we want this one registry.villager profession and then a New identifier tutorial mod that mod id passing in the name after the first closing parenthesis we’re gonna call villager profession builder though we want the profession builder there you go dot create dot id once again making a new identifier calling it tutorial mod mod id comma name and then after two closing Parenthesis dot workstation passing in the type and then we’re also going to say work sound and we’re just going to use sound events dot integer villager armor that’s fine and then after one closing parenthesis dot build and then ending it with a semicolon you can see the builder over Here is of course a builder pattern so you have you know plenty of things that you can basically put in here you can specify the job site secondary job site harvestable items so there’s quite a few things that you can do but this is i believe the minimum you don’t i don’t Think you need a sound in this case but you know supplying a sound also is pretty cool right so those are the three methods that we need all of the quarters of course as always available to you in the description below get up to pass for An individual just as well so let’s then add a public static final and this is going to be a point of interest type in this case and that’s going to be the jumpy poi that’s going to be equal to register poi it’s going to be called jumpy underscore Poi and this is going to be mod block start jump jumpy block there we go so our jumpy block is basically going to be the point of interest for the villager profession that we’re going to add in in one second so this is going to be the public static final villager profession There we go and that’s just going to be called the jump master i didn’t have any other ideas i want to be honest here we’re going to call the register profession over here calling it the jump master and then we’re going to make a registry key dot of so this one right here Passing in registry dot point of interest type key exactly this one it already sometimes it already suggests this to us and a new identifier tutorial mod that mod id and then calling this jumpy and then here jumpy underscore poi and then ending it with a semicolon and What’s very important is that the name given here is the same as the name given here and that should pretty much be all that we need to do now this is it for the classes however we actually need to add a particular tag otherwise it will Not work now this is very important once again we need to go into our data folder minecraft tags and then not in the blocks but in the tags folder we want to right click new directory and this is going to be called point underscore of underscore interest underscore type Extremely important that this is written correctly make sure that it is and then instead of here we need to make a new file and this is going to be called the acquirable underscore job underscore site.json this once again make sure this is written exactly correctly otherwise It will not work if you need to have the spelling laid out for you it is available in the github repository and in the gist as well so you can copy it from there or compare it from there so make sure that this is correct now the contents of this just basically a Completely normal tag in this case and just pointing to the jumpy poi so this always points to the point of interest type not the actual profession so that’s very important for the profession we also need to add a texture so that’s going to be under assets tutorial mode Textures in a new directory called entity and then instead of there another new directory called villager and then inside of there another new directory called profession and then i’m just going to copy over the jump master png over here so this basically is just a recolored version of The armor i believe i just made in my you know cotton blue color basically and that is pretty much all that there is to it there one last thing of course villagers usually have some sort of trades and those trades we can basically add by doing the following so you can do It in your own initialize method you can also make a new method inside of here i believe this should also work so we can just say public static void register trades and we’re going to do the following we’re going to use the trade offer helper this one right here we’re going to say Dot register villager trade offers we’re going to say jump master over here so this is going to be the villager profession the level though so then we need to supply an integer of the level that this needs to have and then we can say factories and you can see it’s a Consumer of a list of factories we’re just going to auto complete this with tab and then we’re just going to make early brackets over here and then here we can add stuff to it but this is how it’s going to look like it’s going to be factories dot add we then need entity Random you can see once again this is the factory that it requires basically so we can autocomplete this again and here we want to make a new trade offer and in this trade offer actually everything goes that we need so we can close this with a semicolon and then we Need the following we need two new item stacks so that’s going to be new item stack let’s say for example of items.emerald and let’s just say it’s going to be like three emeralds and then a new item stack this is going to be what we’re going to Get so let’s say mod items dot eggplant why not so we’re going to get maybe something like five eggplants and then we also wanted to supply the max uses the experience the villager is going to get and then the price multiplier over here and that should be pretty much what We need there we go so this is one example also once again you can get this very easily from the github product or the gist if you want to change the level of that is required for this particular villager to offer this trade you just change this one right here and otherwise I can suggest going into the trade offer so middle mouse button click on this and you can see there’s quite a few things over here that you can use so there’s you know different constructors in this case there’s actually one where you have two items that you have to sell to the Villager and then you get one item from it this is usually done when you have something that is enchanted usually right right so this is probably the best way to look at it and then what we can just do is we can just call this right here as well from Modvillagers.register trades and there we go now this should be everything that we need to add a new custom villager so let’s go into the game and see if it works or if us back in minecraft and let’s just add a villager and let’s see if he’s going to take this particular Job over here and there we go the job has been taken so now i can right click it and you can see the trade that we’ve added here is in there and there’s one little thing in the ian underscore it’s json file that we still have to add but Overall that should be all that we need so that is pretty much how easy it can be to add a custom villager minecraft right so i’ve also added the translation over here it needs to be entity minecraft villager jump master i’m not 100 sure why it needs to be Under minecraft uh it is probably because of the way that we’re registering it but that is just basically how what the translation is going to be but that should then work and then everything should be totally fine well and that concludes this tutorial right here i hope you found This useful and you learn something new i’ll see you all in the next tutorial so yeah Video Information
This video, titled ‘Minecraft 1.19 Fabric Modding Tutorial | CUSTOM VILLAGERS | #10’, was uploaded by Modding by Kaupenjoe on 2022-07-11 13:59:49. It has garnered 5068 views and 133 likes. The duration of the video is 00:10:30 or 630 seconds.
In this Minecraft Modding Tutorial, we are adding custom Villagers and Custom Trades to those Villagers in Minecraft 1.19 using Fabric.
== MINECRAFT COURSES == ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 *
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Fabric-Tutorial-1.19/tree/10-villagers Gist: https://url.kaupenjoe.net/yt357/gist Assets: https://url.kaupenjoe.net/yt357/assets
== TIMESTAMPS == 0:00 Intro 0:19 Creating the ModVillagers Class 5:47 (IMPORTANT) Adding the POI to the Needed Tag 6:46 Adding the Texture 7:16 Adding Trades to our Custom Villager 9:38 Demonstration 10:03 Adding the Name to the en_us.json File 10:20 Outro
== TAKE A LOOK AT MY COURSES WITH COUPON CODES == ▶️ NEW Forge Modding with Minecraft 1.20.X: https://url.kaupenjoe.net/CourseForge120X ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 * ▶️ Complete and Roblox Lua Game Development: https://url.kaupenjoe.net/RobloxCoupon *
== SUPPORT ME ON PATREON == ▶️ https://www.patreon.com/Kaupenjoe
== SOCIALS == Discord: https://discord.com/invite/yqxykanpWf Personal Twitter: https://twitter.com/Kaupenjoe
Instagram: https://url.kaupenjoe.net/tutorials/instagram Facebook: https://url.kaupenjoe.net/tutorials/facebook Twitter: https://url.kaupenjoe.net/tutorials/twitter TikTok: https://url.kaupenjoe.net/tutorials/tiktok Written Tutorials: https://url.kaupenjoe.net/tutorials/blog
== LICENSE == Source Code is distributed under the MIT License. Additional Licenses for other assets can be seen below or in the accompanying CREDITS.txt on download.
== ADDITIONAL CREDITS == Outro Musik by Kevin MacLeod: “That’s a Wrap” Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 3.0 http://creativecommons.org/licenses/by/3.0
== AFFILIATE DISCLAIMER == * Some of the links and other products that appear in the video description are from companies which I will earn an affiliate commission or referral bonus from or are my own products. This means that if you click on one of the product links, I’ll receive a small commission or additional kickback without any additional cost for you. This helps support the channel and allows me to continue to make videos. Thank you for the support!
== HASHTAGS == #Minecraft #MinecraftModding #MinecraftTutorial #Kaupenjoe