I am creating a mod that I want to spawn different entities. I have my items and I can code the recipe for the base spawner. Here is the test code I am using.
Where would I define what entity needs to spawn from the egg? That is for eggs. How would the code look if I then wanted to take the mob egg (ie ZombieSpawnEgg) and use that in a crafting recipe? Thanks in advance.
ItemStack's arguments are {Item, stackSize, damageValue}, so "new ItemStack (Item.monsterPlacer, 92, 1)" creates a stack of 92 monster placers with damage of 1 - the damage value is the one that will determine which entity will spawn. You probably meant to switch those around
Thanks I didn't quite understand but apparently the 1 was the entity id. So I changed it and got it working. Any idea how I would use the item that requires an entity id in a crafting recipe?
That would use say a zombie spawn egg in a recipe? Once I have created that registry line how would I refer to it when typing what A stands for? Im still learning. So not sure what Item to craft means. Also a bit foggy on some other item.
By "ItemToCraft" I meant the item that you want to be crafted, the one you get when you put all the other items in the crafting table. That was just an example using a shapeless recipe, but you can do the same in a shaped recipe:
"XXX", "XAX", "XXX", 'X', ObsidianBar, 'A', Item.diamond
Where would I define what entity needs to spawn from the egg? That is for eggs. How would the code look if I then wanted to take the mob egg (ie ZombieSpawnEgg) and use that in a crafting recipe? Thanks in advance.
That should craft you a stack of 64 diamonds from 8 obsidian bars and one zombie egg.
Side note: You don't need to write "new Object[] {...}" - Java takes care of that for you