Hello guys and welcome matter in the Minecraft Mon to toriel inside episode we’re going to begin through entities in 1.14 and they should also working 1.13 as well so let’s get started the first thing we’re going to do is we’re going to get into our in it and we’re going to Create a tutorial entities and instead of here we’re going to be registering our entities so entities are actually based on entity types now so you want a public static entity type and the type inside of hairtie extends entities but question mark as we don’t know the actual entity when we’re registering it Like this and then we’re going to get the name or ID t so tutorial entity and just leave it declared like that for now we’re going to come back and put some more stuff in there later but we’ll leave that for now there are two of the Things we need to register where your entities and those two things are the spawn egg frost born entity and also registering spawning the entities in the world as well so what we’re going to do is firstly create a function public register entity spawn egg and we’re Going to be creating a spawn egg item so put spawning item item that’s equal to a news wanna get’em then wants to taking that entity type we’re going to add some parameters here because this is a function that we use we are reused multiple times so entity type of Question mark call it tight and put type in here primary and secondary color the two colors on your own spawn egg so the primary color is the main one the secondary one is the one that ii dotted around so these are integers so int color one And in color too and then we go in these parameters and finally since an item is going to be a new item dot properties and then you can add whatever properties you want the group I’m gonna have mine in my normal item group but there we are We have created the spawning item we then need to set age registry name I turned on set registry name tutorial mod registries dot the location function and then we are going to create a string name parameter in here and that’ll be why it’s registered as and we have to Want to return an item here public that return item so does hit return item and that will return our spawning so public static void register entity spawn eggs and this is going to be not just like an item registry so final registry event dot register item and call it event and Inside of here just like within the item registry event dot get registry don’t register all and then inside of our tutorial items we’re going to add a another set of items public static item tutorial entity egg and out of here we’re gonna put two toriel items dot tutorial enter the egg Is equal to register spawn egg tutorial entity the two colors you can go into your web browser and search for a hexadecimal color picker I’ll bring up this nice Google thing here you can choose whatever color you want and you can see you get this 2 f 5 8 8 2 thing So copy that say if you want this blue color and then the color 1 you put the zero X and then paste that number in and that is the primary color and the secondary color let’s put this pinkish color we get this number here 0 X and Then paste it and those are the two colors of a sponeck and then the name is just going to be tutorial entity egg and these are spawn eggs registered we no need to go into tutorial mode registries and beneath this first event the registering items we can put tutorial Entities dot register entity spawn eggs and pay put the event parameter in there and then all register a spawn eggs now back in here we also want to do the world spawning as well so we’re going to create another thing public static void register entity world spawns and want to Be able to register entity in multiple biomes so we do a for loop and biome biome where it goes through all of the biomes that we input as a parameter so put biome dot dot dot I own three dots biomes and that’s the biomes parameter You can put as many balanced as you want if biome is not equal to null biome dot gets pawned and we want to take an an entity classification so add a parameter up here entity classification type know club’s classification so that’s what it takes in that parameter there dot add a New spawn list entry and that takes in our entity so we are going to put entity type entity and then it takes in the weight so I’m gonna put 10 means play around these numbers to figure out how much how often you want your identity to Spawn the minimum group count so the map minimum out of them can look and spawn in the same place one obviously we want at least one spawn all the time and the maximum that can spawn together say 10 and so that that will do it all go Through and each of the biomes that you select it will add your entity to the spawn list so now above that public static void register entity world spawns and just call register entity world spawn tutorial entity entity classification dot creature but obviously there’s other ones as well there’s monster water creature ambient And I put creature and then the biomes you can put as many as you want here so biomes dot why we can say planes the foot and come after that biomes dot beach biomes dot jungle whatever you can keep hurting as many as you want here And all of those will as your entity to spawn in there you can also put a custom biome if you have made one of them or we all get round to in the future tutorials now we need to actually create our entity class so we are going to go into Our packet Craney package here called dot entities and create a new class and just call it tutorial entity and extend and those types of entities and depending on what you want to do and what things and functions you want to have you can just send different things I’m gonna send creature entity I make it’s a public type tutorial let’s do here it takes in a type and that type is going to be dot tutorial entity and it’s going to ask you to cast the argument so just click cast and then override the warning there’s two main things that Characterize your entity’s behavior there are goals register goals is function and attributes you go into the goals here and put this doctor goal selector ad goal the priority at the goal where the lowest parity is or the lowest number is the highest priority so and put new and There’s lots of different types of goals as you can see here here’s just a few of them you can find them all inside of your reference libraries projects new sale dependencies sorry inside a forge net minecraft entity AI and then instead of goal here are all the goals that you Can use a lot of them are generic but some of them are also for specific entities but you may want to use them as well so all entities always have swim goal as their first thing because it makes sure that they if they accidentally fall into water they don’t decide to just drown And try and do something else I’ll mate it’ll break the game crap honestly and new swim goal this then there’s some other goals you can add there’s the random random walking goal which takes in this and the walking speed it goes so you can put a 1.2 Double as now you can test out these values again there’s the look randomly goal and there are also some if you’re creating a monster entity you can do do the nearest attackable target goal or the melee attack goal or the LeapPad target goal then instead of register attributes you can these others To do with health and speed and this don’t get attribute shared monster attributes dot and a lot of things here so you can do max health is it the thing and you can do set base value with this all set the health of your entity so I’m Going to put 20 point zero double that’s about the health of a zombie I believe attack damage if you’re making an attacking mob attack speed but movements B’s probably the other one that everyone needs I’m gonna also put this at one point to double but this may be really High I’m not too showing to test out the values to see how they work for you there plenty of other functions that you can use and you can look through all the different types entity to see it’s any functions that you might use like riding entities you can look at the horse and See if see how that works so you can add it your entities this is a very basic entity here and I have created that now back in tutorial entities we can’t leave register our entity or even it we can initialize our entity so this equal to MC type dot builder dot to create it hips in an eye factory and the classification the factory is your entity tutorial entity : : new so that I mean it creates a factory of your tutorial entity and creates a new version of it and in classification entity classification dot creature ah it Actually in register entity world’s born you do even need to have this parameter here you can just use entity look like a classification so that saves you some a lot of code there so you can remove that make things a little simpler so now I’ve created it we Need to actually build it so build this takes in ID for entity so call it tutorial entity but you also need your mod ID on there so tutorial mod registries dot mod ID + : tutorial entity and then we also need to set the registry name to use the location Function and also say it – tutorial entity now it’s a very long function but that actually initialize your entity and the reason we’re not doing that inside of the time of registries is because the item registry event registers before the entity registry event so we have to initialize that Inside of the entity class or when you’re spoiling is created it will actually work because the entity was created after so now we can actually register it because we’ve initialized it first so once again give a copy of the register blocks function here change it to an entity type registry and call it Register entities then in here we can call event don’t get registry dot register and we can just call tutorial entities dots at Oriel entity that’s all we have to do as we’ve already declared it inside of there and just the final thing here until the register entities Function you’re going to want to call tutorial entities dot register entity worlds bombs so once your entities registered you can also spawn it in the create biomes so then it should spawn in the biomes you’ve set it to and y’all just mess around with the weight and Spawn group values to gauge to be the correct amount so now if you were to create the game the entity doesn’t would actually register but right now it wouldn’t render or anything it would look well they wouldn’t even load the entity at all it’d be invisible as it Doesn’t have a render this is something that we do on the client-side sales create a new package called client and then through two packages one called dot render the other called dot models inside renders we’re gonna create a new class call it a tutorial entity render and it’s going to extend living renderer That takes in the entity and the empty model so entity tutorial entity and tutorial entity model then in models create the classes tutorial entity model and it’s going to extend entity model and that takes in the entity it’s a Tory entity and then we’re going to need to Add the constructor and overhead methods as well we can get rid of these two parameters here and we can just call this one manager if you’re using the latest mappings then you should have This should all be named correctly some reason mine is not but I will update our mappings soon obviously I showed you in the last tutorial how to do that really easily it takes in the model itself new tutorial and see model taking the shadow size so you can mess around with that Value and see how it looks get entity texture mod registries dot location and then we’re going to take in textures entity and then tutorial entity dot PNG and we have to return toriel mod ready to choose a location like that we create what’s called a render factory so we are Going to create a static class called render factory after the implement I render factory for our tutorial entity we’re going to add the element method which is get render for crate render for sorry and then return a new tutorial and surrender manager so Adly returns this and then we call this factory function Inside our side of a new class called tutorial brenda registry create a new class called public static void register entity renderers then called rendering registry dot register entity rendering handler the entity class is entity is tutorial entity dot class and the render factory is a tutorial and surrender dot Render factory so it’s a new toilet energy rendered at render factory then inside of each of these classes that we’ve put in client you need to put apps only in distribution dest dot client so this code will only ever run in the client-side save me in the render here And same in the model as well if you want to know how to create your own custom entity model you can watch the previous answer tutorial where I go through that it’s exactly the same process you just use that model file that you create from the program and put It in here just make sure to add this only in at the top and you might need to change a few names around for the newest version of Minecraft but apart from that it should all be the same but instead of creating a new button your model right Now I’m quite busy I’m just going to extend an entity cowl model so that I can show you everything’s working here so next inside of the client registries function we are going to call tutorial render registry adopt register and surrenders next we need to actually create our texture for our think so we Go into paint.net and you can open up the default minecraft files if you have them downloaded which I believe the link for in the description I have the 1.12 version but you can find the 1.14 version online as well somewhere it just shouldn’t matter there as most things Are still the same or some quite a lot of the textures do change but not for entities so I’m going to get the cow texture here I’m going to just change some calls around to show you that it is working so there we already have this Cow texture now you know file save as and save it inside of your mod folder textures then entity and then call it tutorial and Steve dot PNG and this works the same out if you are using a custom model and that program will automatically generate the textures for Your thing so you just put that texture file into that location so now everything should be declared once I’m feeling something we will test now so we run the game we’re going to client we go into our tutorial Iseman group here I’ve forgotten to actually add the textures For the entity egg but it’s very similar to the normal item creation so it’s fine and if you go in places down I forgot to refresh my dependencies there and press f5 on it and it should read refresh and then if you think f3 and T it will Reload the resource packs and there we are we have the custom entity that’s randomly walking around I think its speed is a bit too fast you also need to go into your line file firstly I turn the top tutorial mod dr. toriel entity egg is a tutorial and stack and then Entity dr. toriel mod dr toriel under Scott and C and that’s just tutorial entity so your line file is now done you just need to create a model item so create a new model here call it tutorial entity egg and just put all your for Louise pup parent item template sponeck should work And there we are we now have these tutorial ends tak it spawns ours tutorial entity if speed is a bit too fast as you can see we’ve got our custom textures our custom textile spawn egg one more thing is about them spawning in the world I do believe it should also be Spawning in the world that I have tested this previously but if you have any issues feel free to join my discord down linked in the description where we can some of my mods all the people can help you with your issues and so thank you for watching this tutorial if you have Enjoyed it please leave a like down below and subscribe for more this took me quite a while to figure out I had quite a lot of issues to spawn eggs so likes and comments I’m most appreciated thank you for watching my name’s been Harry and goodbye Video Information
This video, titled ‘Entities – Minecraft Modding Tutorial 1.14 / 1.14.3’, was uploaded by Harry Talks on 2019-07-03 13:35:28. It has garnered 22895 views and 363 likes. The duration of the video is 00:26:52 or 1612 seconds.
Entities in 1.14! Custom spawn egg, spawning in the world and custom models!
Old Entity Tutorial for Models: https://www.youtube.com/watch?v=p6FFl3yN18M&t=825s
Basic Java Tutorials: http://tiny.cc/JavaTuts Default Textures: http://tiny.cc/DefaultTextures LangToJSon convertor: https://tterrag.com/lang2json/ GitHub: http://tiny.cc/HarryGitHub Discord: https://discordapp.com/invite/xwg8zQJ
#Minecraft #Forge