Posted June 25, 201411 yr Hi, I wanted to create a mod with crafting recipes for mob spawners, so I created a new block and added an event for zombies to, additionally to their standard loot, be able to drop their spawn eggs at a low rate because the recipe includes the new block and the spawn egg. Almost everything works fine, the zombies drop the new loot, but the crafting recipe doesn't work the way I want it to because I can only get pig spawners out of my new recipe. So, my question is: How do you specify mob spawner IDs? My crafting recipe line: GameRegistry.addShapedRecipe(new ItemStack(Blocks.mob_spawner, 1, 54), new Object[] { "SSS", "SZS", "SSS", 'S', new ItemStack(NewOres.spawnerBars, 1), 'Z', new ItemStack(Items.spawn_egg, 1, 54) }); As you can see, I tried to specify the mob spawner with the metadata ID of zombie spawn eggs, but that doesn't work.
June 25, 201411 yr what is that z in the middle? Proud mod developer of: Mob Armor mod Block monster mod Clay Living Dolls mod Much More Spiders mod Elemental cows reborn Mr gorilla mod
June 25, 201411 yr Hi, I wanted to create a mod with crafting recipes for mob spawners, so I created a new block and added an event for zombies to, additionally to their standard loot, be able to drop their spawn eggs at a low rate because the recipe includes the new block and the spawn egg. Almost everything works fine, the zombies drop the new loot, but the crafting recipe doesn't work the way I want it to because I can only get pig spawners out of my new recipe. So, my question is: How do you specify mob spawner IDs? My crafting recipe line: GameRegistry.addShapedRecipe(new ItemStack(Blocks.mob_spawner, 1, 54), new Object[] { "SSS", "SZS", "SSS", 'S', new ItemStack(NewOres.spawnerBars, 1), 'Z', new ItemStack(Items.spawn_egg, 1, 54) }); As you can see, I tried to specify the mob spawner with the metadata ID of zombie spawn eggs, but that doesn't work. GameRegistry.addShapedRecipe(new ItemStack(YourMod.YourItem), "SSS", "SZS", "SZS", 'S', YourMod.YourItem, 'Z', Items.spawn_egg, 1, 54); you need to set it yo be zombie spawn egg like this Proud mod developer of: Mob Armor mod Block monster mod Clay Living Dolls mod Much More Spiders mod Elemental cows reborn Mr gorilla mod
June 25, 201411 yr Author Hi, I wanted to create a mod with crafting recipes for mob spawners, so I created a new block and added an event for zombies to, additionally to their standard loot, be able to drop their spawn eggs at a low rate because the recipe includes the new block and the spawn egg. Almost everything works fine, the zombies drop the new loot, but the crafting recipe doesn't work the way I want it to because I can only get pig spawners out of my new recipe. So, my question is: How do you specify mob spawner IDs? My crafting recipe line: GameRegistry.addShapedRecipe(new ItemStack(Blocks.mob_spawner, 1, 54), new Object[] { "SSS", "SZS", "SSS", 'S', new ItemStack(NewOres.spawnerBars, 1), 'Z', new ItemStack(Items.spawn_egg, 1, 54) }); As you can see, I tried to specify the mob spawner with the metadata ID of zombie spawn eggs, but that doesn't work. GameRegistry.addShapedRecipe(new ItemStack(YourMod.YourItem), "SSS", "SZS", "SZS", 'S', YourMod.YourItem, 'Z', Items.spawn_egg, 1, 54); you need to set it yo be zombie spawn egg like this It is, you don't see it well, but after new ItemStack(NewOres.spawnerBars, 1), there is the 'Z', but then the new line starts, which made it harder to see.
June 25, 201411 yr Hi, I wanted to create a mod with crafting recipes for mob spawners, so I created a new block and added an event for zombies to, additionally to their standard loot, be able to drop their spawn eggs at a low rate because the recipe includes the new block and the spawn egg. Almost everything works fine, the zombies drop the new loot, but the crafting recipe doesn't work the way I want it to because I can only get pig spawners out of my new recipe. So, my question is: How do you specify mob spawner IDs? don't do new object do recipe just like this GameRegistry.addShapedRecipe(new ItemStack(YourMod.YourItem), "SSS", "SZS", "SZS", 'S', YourMod.YourItem, 'Z', Items.spawn_egg, 1, 54); it will always work , for blocks and items My crafting recipe line: GameRegistry.addShapedRecipe(new ItemStack(Blocks.mob_spawner, 1, 54), new Object[] { "SSS", "SZS", "SSS", 'S', new ItemStack(NewOres.spawnerBars, 1), 'Z', new ItemStack(Items.spawn_egg, 1, 54) }); As you can see, I tried to specify the mob spawner with the metadata ID of zombie spawn eggs, but that doesn't work. GameRegistry.addShapedRecipe(new ItemStack(YourMod.YourItem), "SSS", "SZS", "SZS", 'S', YourMod.YourItem, 'Z', Items.spawn_egg, 1, 54); you need to set it yo be zombie spawn egg like this It is, you don't see it well, but after new ItemStack(NewOres.spawnerBars, 1), there is the 'Z', but then the new line starts, which made it harder to see. Proud mod developer of: Mob Armor mod Block monster mod Clay Living Dolls mod Much More Spiders mod Elemental cows reborn Mr gorilla mod
June 25, 201411 yr Author Hi, I wanted to create a mod with crafting recipes for mob spawners, so I created a new block and added an event for zombies to, additionally to their standard loot, be able to drop their spawn eggs at a low rate because the recipe includes the new block and the spawn egg. Almost everything works fine, the zombies drop the new loot, but the crafting recipe doesn't work the way I want it to because I can only get pig spawners out of my new recipe. So, my question is: How do you specify mob spawner IDs? don't do new object do recipe just like this GameRegistry.addShapedRecipe(new ItemStack(YourMod.YourItem), "SSS", "SZS", "SZS", 'S', YourMod.YourItem, 'Z', Items.spawn_egg, 1, 54); it will always work , for blocks and items My crafting recipe line: GameRegistry.addShapedRecipe(new ItemStack(Blocks.mob_spawner, 1, 54), new Object[] { "SSS", "SZS", "SSS", 'S', new ItemStack(NewOres.spawnerBars, 1), 'Z', new ItemStack(Items.spawn_egg, 1, 54) }); As you can see, I tried to specify the mob spawner with the metadata ID of zombie spawn eggs, but that doesn't work. GameRegistry.addShapedRecipe(new ItemStack(YourMod.YourItem), "SSS", "SZS", "SZS", 'S', YourMod.YourItem, 'Z', Items.spawn_egg, 1, 54); you need to set it yo be zombie spawn egg like this It is, you don't see it well, but after new ItemStack(NewOres.spawnerBars, 1), there is the 'Z', but then the new line starts, which made it harder to see. I tried without new Object[], but it just works the same way. No zombie spawner, I get a pig spawner, instead.
June 25, 201411 yr idk then lol Proud mod developer of: Mob Armor mod Block monster mod Clay Living Dolls mod Much More Spiders mod Elemental cows reborn Mr gorilla mod
June 25, 201411 yr Author You can't create an Item for a ZombieSpawner. The mob being spawned is TileEntity data, and Mojang added a way to include that only in the 1.8 snapshots so you can't use it yet. You need to make your own Item. Alright, thanks for the clarification. Guess I'll have to wait, then.
June 26, 201411 yr You dont have to wait i think what diesieben07 was saying is you just have to create a custom item that places a vanilla mob spawner of the type you want. e.g. @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { world.setBlock(x, y+1, z, Blocks.mob_spawner); TileEntityMobSpawner spawner = (TileEntityMobSpawner)world.getTileEntity(x, y+1, z); spawner.func_145881_a().setEntityName("Zombie"); player.inventory.consumeInventoryItem(player.getCurrentEquippedItem().getItem()); return true; } That will place a spawner above the block you click set its type to Zombie then consume the item. I am the author of Draconic Evolution
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.