Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted
  On 6/25/2014 at 8:47 PM, NigNog420 said:

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

Posted
  On 6/25/2014 at 8:54 PM, Soulas97 said:

  Quote

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.

Posted
  On 6/25/2014 at 8:58 PM, NigNog420 said:

  Quote

  Quote

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

Posted
  On 6/25/2014 at 9:00 PM, Soulas97 said:

  Quote

  Quote

  Quote

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.

Posted
  On 6/25/2014 at 9:19 PM, diesieben07 said:

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.

Posted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

ร—   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

ร—   Your link has been automatically embedded.   Display as a link instead

ร—   Your previous content has been restored.   Clear editor

ร—   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Looking for unbeatable savings on Temu in 2025? Our exclusive Temu code [ald244107] is your key to unlocking a $100 OFF discount, plus much more! This verified promo code works for both new and existing customers, giving you up to 50% off your next order and even bigger savings on clearance items. With Temu coupon code [ald244107], you'll get a flat $100 discount on top of existing sales. First-time users can enjoy an extra 100% off select items, while returning shoppers automatically qualify for the $100 OFF when applying the code at checkout. Imagine saving up to 90% on your favorite products across the USA, Canada, UK, and many other countries! ๐Ÿ”ฅ Temu Coupon Highlights with Code [ald244107]:  * Temu New User Offer: Use ald244107 for 50% off your first order + $100 OFF.  * Temu Existing Customer Promo: Apply ald244107 to get an instant $100 OFF.  * Global Reach: Valid in the USA, UK, Canada, Germany, France, Japan, Chile, Colombia, Malaysia, Mexico, South Korea, Philippines, Saudi Arabia, Qatar, Pakistan, and more.  * Top 2025 Deal: Secure $200 OFF plus 100% bonus discounts with ald244107. Maximize Your Savings: Top Temu Deals for 2025 (Code: ald244107)  * โœ… Temu Memorial Day Sale: Save $100 with ald244107  * โœ… Temu First Order Special: Use ald244107 for 50% + $100 OFF  * โœ… Temu USA Exclusive: Get $100 off instantly with ald244107  * โœ… International Temu Codes: ald244107 works in Japan, Germany, Chile, and many others.  * โœ… Temu Reddit Discount: Enjoy $100 OFF for both new and old users.  * โœ… Temu Coupon Bundle 2025: Combine $100 OFF with up to 50% slash deals.  * โœ… 100% OFF Free Gift Code: Use ald244107 โ€“ no invitation needed!  * โœ… Temu Sign-Up Bonus: Instantly get a welcome $100 OFF.  * โœ… Free Temu Code for New Users: Apply ald244107 โ€“ no referral required.  * โœ… Temu Clearance Codes 2025: Use ald244107 for 85โ€“100% discounts. This Temu code [ald244107] is more than just a discount; it's your ticket to free shipping, exclusive first-order deals, and stackable coupon bundles across electronics, fashion, home goods, and beauty products. You can truly unlock up to 90% OFF plus an additional $100 OFF on qualified orders. ๐Ÿ’ก Pro Tip: Don't forget to apply ald244107 during checkout on the Temu app or website to activate your instant $100 discount, even if youโ€™re a returning customer! Temu $100 OFF Code by Country (All Use ald244107):  * ๐Ÿ‡บ๐Ÿ‡ธ Temu USA โ€“ ald244107  * ๐Ÿ‡ฏ๐Ÿ‡ต Temu Japan โ€“ ald244107  * ๐Ÿ‡ฒ๐Ÿ‡ฝ Temu Mexico โ€“ ald244107  * ๐Ÿ‡จ๐Ÿ‡ฑ Temu Chile โ€“ ald244107  * ๐Ÿ‡จ๐Ÿ‡ด Temu Colombia โ€“ ald244107  * ๐Ÿ‡ฒ๐Ÿ‡พ Temu Malaysia โ€“ ald244107  * ๐Ÿ‡ต๐Ÿ‡ญ Temu Philippines โ€“ ald244107  * ๐Ÿ‡ฐ๐Ÿ‡ท Temu Korea โ€“ ald244107  * ๐Ÿ‡ต๐Ÿ‡ฐ Temu Pakistan โ€“ ald244107  * ๐Ÿ‡ซ๐Ÿ‡ฎ Temu Finland โ€“ ald244107  * ๐Ÿ‡ธ๐Ÿ‡ฆ Temu Saudi Arabia โ€“ ald244107  * ๐Ÿ‡ถ๐Ÿ‡ฆ Temu Qatar โ€“ ald244107  * ๐Ÿ‡ซ๐Ÿ‡ท Temu France โ€“ ald244107  * ๐Ÿ‡ฉ๐Ÿ‡ช Temu Germany โ€“ ald244107 Real Shoppers, Real Savings: User Reviews We love hearing about your experiences! Hereโ€™s what some happy shoppers are saying about using the Temu code [ald244107]:  * Alice W., USA โญ๏ธโญ๏ธโญ๏ธโญ๏ธโญ๏ธ (5/5) "Great experience! Temu's promo code {ald244107} saved me a lot on my first order. Highly recommend this offer!"  * James T., UK โญ๏ธโญ๏ธโญ๏ธโญ๏ธ (4/5) "Very happy with the quality and prices on Temu. The $100 credits offer was a nice bonus using {ald244107}. Will shop again."  * Sara M., Canada โญ๏ธโญ๏ธโญ๏ธ (3/5) "Got some decent deals with the {ald244107} code, though shipping took a bit longer than expected. Overall satisfied with the credits."
    • Thank you so much! I didnt see it in the log๐Ÿ˜ญ๐Ÿ˜ญ  
    • So im completely new to modding in general, i have some experience in Behavior packs in minecraft bedrock and i would like to modify entities stats and attributes like in a behavior pack (health, damage, speed, xp drop...). The problem is that i cant find any information online on how to do that, and I have no clue on what to do and where to start. I am currently modding in 1.20.4 with IntelliJ if that helps. My final objective is to buff mobs health and damage (double it for exemple), but since there is no entity file anywhere i don't know how to change it... ๐Ÿ˜ข
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
  • Topics

ร—
ร—
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.