I am in the process of creating some minecraft forge modding tutorials. Setting UpConfigurationsItemsBlocksCreative TabCrafting and SmeltingToolsOre GenerationArmorItem Properties Animated Textures Custom Block Models Dungeon/Chest Hooks Mobs Biomes Trees Liquids Dimensions
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.
Updated! Added item properties to my tutorial series!
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Hey! First off, great tutorials very easy to follow and very informative as well. Keep at it!
Now on to my question. In my mod i have an item (lets call it a gem) that is going to be used to create other items. Now what i want to happen, is when you use the gem in the crafting recipe you get the item you intended to craft but you also get the gem back. I have searched all over the place and i cannot seem to find any way to do this in 1.11. Think you can help?
Add .setContainerItem(<your_gem>) to one of your ingrediants I think? I don't know, that's a toughy. I also would like to know. I'm looking into metadata and item damage right now. I will totally add that to the crafting tutorial once I find out.
I don't know for sure, but what I've usually seen is that it subtracts one value from the item stack when used for crafting, but I don't quite recall if there is a method for that or if you have to Override the crafting method in the file you're writing to make the necessary changes. It's all about digging around in the library and reading what everything does
I know the AI's are complex in the checks it makes to determine behavior, for some, but I think the first time I tried to register a new AI, I posted it (maybe not correctly) to EVENT_BUS, and it said it didn't know what to do with the registered event. Also I'm still trying to learn a lot about the new rendering bit, so I'm not familiar with how you determine the shape of your mob (i.e. the difference between a zombie and a spider)
I don't know for sure, but what I've usually seen is that it subtracts one value from the item stack when used for crafting, but I don't quite recall if there is a method for that or if you have to Override the crafting method in the file you're writing to make the necessary changes. It's all about digging around in the library and reading what everything does
Thats one way to do it but i dont want the item to take durability damage, instead i just want it to be there when you get done crafting. An example of this is the Blood Magic mod. In that mod you have an orb that you can use to craft with however the orb is still there when you get done crafting. From what ive seen you would have to write your own custom CraftingHandler but from what i can tell that has either been replaced or removed.
I have work in a little, so I did a little quick digging, but take a look at getContainerItem(ItemStack stack) under ForgeHooks. It fires PlayerDestroyItemEvent. This is called all the way from ShapedRecipes, so you need to basically write your own recipe file that extends ShapedRecipes and gets rid of line 40 under it. It's a little more complex than that because I'm sure you have to register an event for it, but ask Alex. I didn't have time to give you an outlining answer, but that's the line that causes a subtraction from the stack, so it's something to work with
So i just got home and tried what you said and magically it works! All i had to do was attach .setContainerItem(<your_item>) to the crafting recipie of the item i wanted to get back.;
Oh I see now, yeah if they're not linked, it means I haven't done a tutorial on them yet. I am currently working on entities so expect that in the next week
The Meaning of Life, the Universe, and Everything.
Location:
California
Join Date:
6/21/2013
Posts:
45
Location:
California, USA
Minecraft:
Creepinson101
Xbox:
Creepinson101
Member Details
I have an idea for your tutorials. It doesn't have to be in the tutorials right now, since it is very advanced. My idea is the multiblock structures and the big, custom models from Immersive Engineering, such as the Arc Furnace. You should cover multiblock structures first, and eventually get into custom multiblock structure models.
The Meaning of Life, the Universe, and Everything.
Join Date:
6/26/2011
Posts:
45
Location:
Ontario
Minecraft:
LM64
Member Details
Hey, great tutorials so far. I noticed a bit of an error in the Tools section. If you just do what your tutorial says, then while everything compiles fine and stuff, but the tools won't show up in their respective creative tabs, or any for that matter.
I got around this by adding a "CreativesTab tab" argument to the constructors of all the tools, and added a "setCreativeTab(tab)" to the bodies of them. Then, adding "CreativeTabHandler.tabTools" to the initialization lines in ItemHandler for the tools, and "CreativeTabHandler.Combat" for the sword.
Hey, great tutorials so far. I noticed a bit of an error in the Tools section. If you just do what your tutorial says, then while everything compiles fine and stuff, but the tools won't show up in their respective creative tabs, or any for that matter.
I got around this by adding a "CreativesTab tab" argument to the constructors of all the tools, and added a "setCreativeTab(tab)" to the bodies of them. Then, adding "CreativeTabHandler.tabTools" to the initialization lines in ItemHandler for the tools, and "CreativeTabHandler.Combat" for the sword.
Interesting. I wonder how I never caught that. Thanks for the catch! I will definitely update!
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
The Meaning of Life, the Universe, and Everything.
Join Date:
6/26/2011
Posts:
45
Location:
Ontario
Minecraft:
LM64
Member Details
I'm having some more troubles, this time with Ore Gen. Everything compiles, but my ore doesn't seem to be spawning in the world.
It might be related to predicates, but I'm not sure. I was prompted to choose from 4 versions of predicate, and com.google.common.base.Predicate was the only one that didn't cause Eclipse to throw a bunch of red lines at me. Was it the same one you used?
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I will be making tutorials on entities. I am still trying to figure out the AI's but once I do, then I will definitely update!
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Hey! First off, great tutorials very easy to follow and very informative as well. Keep at it!
Now on to my question. In my mod i have an item (lets call it a gem) that is going to be used to create other items. Now what i want to happen, is when you use the gem in the crafting recipe you get the item you intended to craft but you also get the gem back. I have searched all over the place and i cannot seem to find any way to do this in 1.11. Think you can help?
Add .setContainerItem(<your_gem>) to one of your ingrediants I think? I don't know, that's a toughy. I also would like to know. I'm looking into metadata and item damage right now. I will totally add that to the crafting tutorial once I find out.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I don't know for sure, but what I've usually seen is that it subtracts one value from the item stack when used for crafting, but I don't quite recall if there is a method for that or if you have to Override the crafting method in the file you're writing to make the necessary changes. It's all about digging around in the library and reading what everything does
I know the AI's are complex in the checks it makes to determine behavior, for some, but I think the first time I tried to register a new AI, I posted it (maybe not correctly) to EVENT_BUS, and it said it didn't know what to do with the registered event. Also I'm still trying to learn a lot about the new rendering bit, so I'm not familiar with how you determine the shape of your mob (i.e. the difference between a zombie and a spider)
Thats one way to do it but i dont want the item to take durability damage, instead i just want it to be there when you get done crafting. An example of this is the Blood Magic mod. In that mod you have an orb that you can use to craft with however the orb is still there when you get done crafting. From what ive seen you would have to write your own custom CraftingHandler but from what i can tell that has either been replaced or removed.
I have work in a little, so I did a little quick digging, but take a look at getContainerItem(ItemStack stack) under ForgeHooks. It fires PlayerDestroyItemEvent. This is called all the way from ShapedRecipes, so you need to basically write your own recipe file that extends ShapedRecipes and gets rid of line 40 under it. It's a little more complex than that because I'm sure you have to register an event for it, but ask Alex. I didn't have time to give you an outlining answer, but that's the line that causes a subtraction from the stack, so it's something to work with
So i just got home and tried what you said and magically it works! All i had to do was attach .setContainerItem(<your_item>) to the crafting recipie of the item i wanted to get back.;
Like so:
What's stp download?
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Some of those words for topics aren't build into links is that a mistake or just not needed stuff?
Could you reiterate for me please? I don't seem to understand what you mean.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
He's saying some of the items you have listed under your tutorial don't have links. He was asking if they're just there or if it was a mistake
Oh I see now, yeah if they're not linked, it means I haven't done a tutorial on them yet. I am currently working on entities so expect that in the next week
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I have an idea for your tutorials. It doesn't have to be in the tutorials right now, since it is very advanced. My idea is the multiblock structures and the big, custom models from Immersive Engineering, such as the Arc Furnace. You should cover multiblock structures first, and eventually get into custom multiblock structure models.
alex thanks nice tutorial.
maybe typo in creative-tabs-and-enuslang.html
public static CreativeTabs tabBlocks = new CreativeTabs("tut_blocks"){
Nice catch there! Does that give you an error when you load up the game? Cause I don't think I do. But I will look into it and change it. Thanks!
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Hey, great tutorials so far. I noticed a bit of an error in the Tools section. If you just do what your tutorial says, then while everything compiles fine and stuff, but the tools won't show up in their respective creative tabs, or any for that matter.
I got around this by adding a "CreativesTab tab" argument to the constructors of all the tools, and added a "setCreativeTab(tab)" to the bodies of them. Then, adding "CreativeTabHandler.tabTools" to the initialization lines in ItemHandler for the tools, and "CreativeTabHandler.Combat" for the sword.
Interesting. I wonder how I never caught that. Thanks for the catch! I will definitely update!
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
I'm having some more troubles, this time with Ore Gen. Everything compiles, but my ore doesn't seem to be spawning in the world.
It might be related to predicates, but I'm not sure. I was prompted to choose from 4 versions of predicate, and com.google.common.base.Predicate was the only one that didn't cause Eclipse to throw a bunch of red lines at me. Was it the same one you used?