Started by
kamehamehaa
on
Topic category: Help with Minecraft modding (Java Edition)
Hey,
I have a problem. I tried creating a recipe for a Skeleton spawn egg, but it doesn't quite work. I can craft everything the way I want, but I don't receive a Skeleton Egg but an "empty" Spawn Egg. It does nothing when used.
I think the problem lies here : the code uses this
"ItemStack recStack = new ItemStack(Items.SPAWN_EGG, 1, 51);"
which i think is outdated. It's like saying "/give Player minecraft:spawn_egg 1 51", but that gives you the "empty" spawn egg.
It should be like this:
" /give Player minecraft:spawn_egg 1 0 {EntityTag:{id:"Skeleton"}} "
but how do I get that in the Code?
thanks for your help in advance
Edited by kamehamehaa on Sat, 10/29/2016 - 23:19
I looked up the Skeleton ID and it gave two. I would try, removing the (1,51); to a (1,33); and recompile that code.
I looked up the Skeleton ID and it gave two. I would try, removing the (1,51); to a (1,33); and recompile that code.
no, i've just tested it. It doesn't matter which ID you use, you'll always just get the regular spawn egg :/
I have an idea to implement Skeleton egg, although its not dirrectly like a spawn egg.
First, go to "items" create the mod and name it "skeleton spawn egg" or whatever you want. Now do whatever for everything until you reach "Events" page. Choose "Right click on Block". Now here we get a little more confusing.
Locate the "Stacked Event" choose it, now choose "Add event result" now find "Consume item in Inventory" choose the egg you make. Now click "Add event result on the bottom. finnaly click "stacked event" again, choose 'Consume Item In Inventory" add that event, and again click add event on the bottom page.
------------------------------------------------
This would make it so you could spawn in a Skeleton, but at the same time the egg will dissapear, (so you cant spawn infinte ammount of them, unless you want to.)
Thanks mate, it worked perfectly :)
@#4 Now that is a perfect example of how events should be used ;)