Posted July 25, 20178 yr So I was bored and decided to make a mod that would allow me to craft spawn eggs. The only issue I have is that I have no clue how to edit the NBT of the output so it sets the egg to spawn a specified mob. GameRegistry.addShapedRecipe(new ItemStack(Items.SPAWN_EGG, 1, 93), new Object[] { "FEF", "EIE", "FEF", 'E', Items.EGG, 'F', Items.EMERALD, 'I', Items.FEATHER }); The recipe is registered and works but I end up with a blank spawn egg. (The above is supposed to allow me to craft a chicken egg)
July 25, 20178 yr 8 minutes ago, diesieben07 said: To apply the entity ID to the stack use ItemMonterPlacer::applyEntityIdToItemStack. This method is marked as client-only in 1.11.2, so you can't call it directly. Instead, you need to create your own method that does the same thing. It's no longer client-only in 1.12 (because Forge patches Item#getSubItems and the methods used by it to be available on both sides), so you can use it directly. Edited July 25, 20178 yr by Choonster Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.