My series are going to be in depth with lots of code snippets. There are not a lot of 1.11 tutorials out there right now that are in depth and beginner friendly. If you have any suggestions on what I should cover, drop it in a thread reply below!
If you have any questions, please do research before emailing or dming me regarding anything.
I wrote the previous thread hoping someone would reply on how to register new and removed tasks of mobs. I understand how to write the doTaskStuff() portion in a class, but i don't know how to actually register it to be fired each time a mob is spawned. Also I'm pretty much beyond registering blocks and adding recipes for the most part, but any questions I have I'll definitely drop here. One I did have though was how to map out textures that don't apply to a whole 1x1x1 space (i.e. fence posts and how it renders the connecting beams between posts)
Ah custom models. I have only made one custom model but it has to do with the blockstates and models.
If we look in the fence blockstates, it has the conditions "when" and "apply", suggesting that when it is facing a specific direction, it will render a model in that direction, rotating it a certain amount of degrees. Looking in the block models, we see that there is "fence_post" and "fence_side", so that under certain conditions, it will render one of the models.
As for the textures, it uses it's own wrapping system, but you can use your own textures if you would like to. I just may do a tutorial on custom block models once I understand the texturing more. I have made a crappy trampoline mod that uses vanilla textures, but once I play around with blockstates, I will definitely hack into it more with my tutorials.
For now, try looking into the vanilla files more and seeing what they do, and see if you can use that to your advantage.
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I've done a huge amount of reading through the libraries, but I think my hugest issue is not knowing the syntax of .json files (I understand mostly that minecraft searches files like .json and .dat for keywords or tags), but I haven't worked much with those yet other than manually overwriting portions of .dat files to manipulate the player's info. I'm not familiar with the wrapping system, but I will definitely be working more with conditions and applying textures to specific faces of blocks. Also with the new .json system that Minecraft has been using since 1.8, I don't know the purpose of each of the 3 files for blocks yet, but I'm still trying to learn how to work with entities and registering their tasks to an event handler too.
To answer your curiosity about the three files for the blocks is very simple:
blockstates is the file that states what model the block should use to render depending on a specific side, for example, furnaces use the same model, just rotated depending on which way the player is facing.
block model is the model that the block will render in the world when it is placed down.
item model is the model that is used when it is in the inventory.
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
This looks for the inventory renering model, being the item model.
As for the wrapping part I don't understand it much myself either but I will in time.
Entity task registering, do you mean custom tasks, or just giving an entity a tasks?
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
It will take a bit depending on your computer and Internet. It can be misleading to see people breeze through that part, but you may also need to allot more RAM for the setup. To do that, you go to the forge folder that you setup to run gradlew in, open the gradle.properties file (I use Visual Studio Code), and change the last line to say org.gradle.jvmargs=-Xmx3G. You can change the number to whatever gigabytes of memory you are comfortable with your computer running, and the units are interchangeable (i.e. 3G is the same as 3072M). As for the entities part, I haven't taken a look at writing my own custom AI's yet, but it seems pretty straightforward. I just don't know how to give an entity a task. I know to write out the TheEntity.tasks.addTask(Priority, new TaskIWantToAdd), but I don't know how to initialize that when the mod runs so that it is registered for Forge to call on each time a mob is spawned.
Honestly the thing that would make the most sense is finding open source mods to reference from. I've just been busy, but I also want to try to be a little more active with other people in the community, especially if I'm going to work on modding
1, 1, 3 are, in order, the weight of the mob spawn, the lower the number the more likely it will spawn. The second integer is the minimum number that will spawn in a group, the third integer is the max number that can spawn in a group. CREATURE_TYPE is what kind of creature it is so Skeletons are MONSTER, so are Zombies. Spiders are AMBIENT so they don't burn in sunlight. Endermen are CREATURE, being neutral and all. Squid are WATER_CREATURE. You can get the biomes you want them to spawn in from Biomes class.
Here is a complete guide on Entity AI's. I will be writing my own soon as well.
Before I forget, you will also need to add an egg as well. There is a cleaner way of going about this but this is as much as I understand it.
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Sounds about right. I haven't meddled with overriding minecraft events, but to my understanding you gotta remove the spawn from the world, create a class that has all the new stuff for the cow, then register that new class as the cow. I would extend it to EntityCow so that you inherently get all the cow stuff without having to rewrite it all. That is to my understanding. There is a thread on it here.
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I am in the process of creating some minecraft forge modding tutorials. Setting UpConfigurationsItemsBlocks Tools Armor Ore Generation Dungeon/Chest Hooks More to come...
My series are going to be in depth with lots of code snippets. There are not a lot of 1.11 tutorials out there right now that are in depth and beginner friendly. If you have any suggestions on what I should cover, drop it in a thread reply below!
If you have any questions, please do research before emailing or dming me regarding anything.
Update! Added a block tutorial!
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Building takes a while. Sometimes it takes up to 10 minutes to complete for me depending on the day.
OK, Ill try again and let it wait, thanks
Oh, I also have another question. When I downloaded the JRE, instead of an exe java file, like the JDK, it gave me a zipped file, is it supposed to be like that?
I went back to the downloads page and saw a version called windows x64 offline, this one is an exe so im guessing that's the one I should get
Oh, I also have another question. When I downloaded the JRE, instead of an exe java file, like the JDK, it gave me a zipped file, is it supposed to be like that?
I went back to the downloads page and saw a version called windows x64 offline, this one is an exe so im guessing that's the one I should get
Thatis correct. Sorry I should have specified but yes get the executable
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Hey Alex, just wanted to say thanks for doing this! I am an engineer, but I haven't ever tried to mod Minecraft. I'm already well into the Item tutorial and glad to make some progress! So thanks, and keep it up!
I am in the process of creating some minecraft forge modding tutorials.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I wrote the previous thread hoping someone would reply on how to register new and removed tasks of mobs. I understand how to write the doTaskStuff() portion in a class, but i don't know how to actually register it to be fired each time a mob is spawned. Also I'm pretty much beyond registering blocks and adding recipes for the most part, but any questions I have I'll definitely drop here. One I did have though was how to map out textures that don't apply to a whole 1x1x1 space (i.e. fence posts and how it renders the connecting beams between posts)
Ah custom models. I have only made one custom model but it has to do with the blockstates and models.
If we look in the fence blockstates, it has the conditions "when" and "apply", suggesting that when it is facing a specific direction, it will render a model in that direction, rotating it a certain amount of degrees. Looking in the block models, we see that there is "fence_post" and "fence_side", so that under certain conditions, it will render one of the models.
As for the textures, it uses it's own wrapping system, but you can use your own textures if you would like to. I just may do a tutorial on custom block models once I understand the texturing more. I have made a crappy trampoline mod that uses vanilla textures, but once I play around with blockstates, I will definitely hack into it more with my tutorials.
For now, try looking into the vanilla files more and seeing what they do, and see if you can use that to your advantage.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I've done a huge amount of reading through the libraries, but I think my hugest issue is not knowing the syntax of .json files (I understand mostly that minecraft searches files like .json and .dat for keywords or tags), but I haven't worked much with those yet other than manually overwriting portions of .dat files to manipulate the player's info. I'm not familiar with the wrapping system, but I will definitely be working more with conditions and applying textures to specific faces of blocks. Also with the new .json system that Minecraft has been using since 1.8, I don't know the purpose of each of the 3 files for blocks yet, but I'm still trying to learn how to work with entities and registering their tasks to an event handler too.
To answer your curiosity about the three files for the blocks is very simple:
blockstates is the file that states what model the block should use to render depending on a specific side, for example, furnaces use the same model, just rotated depending on which way the player is facing.
block model is the model that the block will render in the world when it is placed down.
item model is the model that is used when it is in the inventory.
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
This looks for the inventory renering model, being the item model.
As for the wrapping part I don't understand it much myself either but I will in time.
Entity task registering, do you mean custom tasks, or just giving an entity a tasks?
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
In the first link, (setting up) when I run the run.bat file it goes through until it stops at "> Building 44% > :decompileMc". Help?
Does it close the program?
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
It will take a bit depending on your computer and Internet. It can be misleading to see people breeze through that part, but you may also need to allot more RAM for the setup. To do that, you go to the forge folder that you setup to run gradlew in, open the gradle.properties file (I use Visual Studio Code), and change the last line to say org.gradle.jvmargs=-Xmx3G. You can change the number to whatever gigabytes of memory you are comfortable with your computer running, and the units are interchangeable (i.e. 3G is the same as 3072M). As for the entities part, I haven't taken a look at writing my own custom AI's yet, but it seems pretty straightforward. I just don't know how to give an entity a task. I know to write out the TheEntity.tasks.addTask(Priority, new TaskIWantToAdd), but I don't know how to initialize that when the mod runs so that it is registered for Forge to call on each time a mob is spawned.
Honestly the thing that would make the most sense is finding open source mods to reference from. I've just been busy, but I also want to try to be a little more active with other people in the community, especially if I'm going to work on modding
Oh I see what you mean now, as regarding the entity task. You can use the following code:
EntityRegistry.addSpawn(<YourEntity>.class, 1, 1, 3, EnumCreatureType.<CREATURE_TYPE>, Biomes.<BIOMES_TO_SPAWN_IN>);
1, 1, 3 are, in order, the weight of the mob spawn, the lower the number the more likely it will spawn. The second integer is the minimum number that will spawn in a group, the third integer is the max number that can spawn in a group. CREATURE_TYPE is what kind of creature it is so Skeletons are MONSTER, so are Zombies. Spiders are AMBIENT so they don't burn in sunlight. Endermen are CREATURE, being neutral and all. Squid are WATER_CREATURE. You can get the biomes you want them to spawn in from Biomes class.
Here is a complete guide on Entity AI's. I will be writing my own soon as well.
Before I forget, you will also need to add an egg as well. There is a cleaner way of going about this but this is as much as I understand it.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
If you want to find open source mods just search it in Google. Here is a list of open sourced minecraft mods that you can look at
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
So let's say I wanted to make cows hostile, I would just add the tasks and then re-register the mob?
Sounds about right. I haven't meddled with overriding minecraft events, but to my understanding you gotta remove the spawn from the world, create a class that has all the new stuff for the cow, then register that new class as the cow. I would extend it to EntityCow so that you inherently get all the cow stuff without having to rewrite it all. That is to my understanding. There is a thread on it here.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Ok that's perfect. I'll definitely take a look at that
It doesn't close,but it's probably just my computer, I was just seeing if my problem is normal.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Building takes a while. Sometimes it takes up to 10 minutes to complete for me depending on the day.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
OK, Ill try again and let it wait, thanks
Oh, I also have another question. When I downloaded the JRE, instead of an exe java file, like the JDK, it gave me a zipped file, is it supposed to be like that?I went back to the downloads page and saw a version called windows x64 offline, this one is an exe so im guessing that's the one I should get
Thatis correct. Sorry I should have specified but yes get the executable
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Hey Alex, just wanted to say thanks for doing this! I am an engineer, but I haven't ever tried to mod Minecraft. I'm already well into the Item tutorial and glad to make some progress! So thanks, and keep it up!