Jump to content

[Solved][1.8.9] How to craft villager spawn egg?


OrangeVillager61

Recommended Posts

How to craft villager spawn eggs? I using the entity id as the id type (like salmon) but this does not work.

GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 120), new Object[]
    		  {"BBB",
    		   "VAE",
    		   "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_biomatter, Character.valueOf('V'), MoDropsBlocks.villager_nose, Character.valueOf('E'), Items.emerald});

Link to comment
Share on other sites

So like this?

 

GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, "EntityVillager")

 

or

net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound();
      nbt.setString("EntityVillager", "120");
      GameRegistry.addRecipe(new ItemStack(Items.spawn_egg.setTagCompound(nbt))

 

I don't really know nbt...

Link to comment
Share on other sites

Yes, I looked at it.

 

Okay I got to this, but eclipse says that for "new ItemStack(Items.spawn_egg).setTagCompound(nbt))" it cannot convert from ItemStack to void.

 

 net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound();
      nbt.setString("EntityVillager", "120");
      ItemStack VillagerEgg = new ItemStack(Items.spawn_egg).setTagCompound(nbt));
      GameRegistry.addRecipe(VillagerEgg); new Object[]
    		  {"BBB",
    		   "VAE",
    		   "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_biomatter, Character.valueOf('V'), MoDropsBlocks.villager_nose, Character.valueOf('E'), Items.emerald}++;

Link to comment
Share on other sites

This works for me:

 

//Villager Egg
	GameRegistry.addRecipe(new ItemStack (Items.spawn_egg, 1, 120),
					new Object [] {
							"BBB",
							"BBB",
							"BBB",
							'B', Items.diamond,
			});

 

width=428 height=158https://scontent-lhr3-1.xx.fbcdn.net/v/t34.0-12/13228057_1001880076528542_159516703_n.png?oh=512a75d717e904d4380aced963874eff&oe=57411A8F[/img]

 

I don't think it's the best way for it and it might have a problem when using it outside your work space but hopefully will work.

Link to comment
Share on other sites

Yeah... with some work and wonkiness I can get (Items.spawn_egg, 1, 120) to work, but it is not really a good way. Anyhow, if .setTagCompound(nbt)) returns a void, is there alternative or I convert it?

 

Create the

ItemStack

, call

ItemStack#setTagCompound

then pass the

ItemStack

to

GameRegistry.addRecipe

.

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.

Link to comment
Share on other sites

My next issue is that the spawn egg is labeled entity.EntityVillager.name. What is the problem now?

 

 net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound();
      nbt.setString("entity_name", "EntityVillager");
      ItemStack VillagerEgg = new ItemStack(Items.spawn_egg);
      VillagerEgg.setTagCompound(nbt);
      GameRegistry.addRecipe((VillagerEgg), new Object[]

Link to comment
Share on other sites

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

    • It all began with a chance encounter with a testimonial shared by Olivia, a fellow traveler on the winding road of cryptocurrency. Her words spoke of a miraculous recovery orchestrated by Wizard Web Recovery, a beacon of hope in the murky waters of online fraud. Intrigued by her story, I reached out to Wizard Web Recovery, hoping they could work their magic on my blocked crypto recovery. With bated breath, I shared my plight, providing evidence of my dilemma and praying for a solution. To my astonishment, a prompt response came, swift and reassuring. Wizard Web Recovery wasted no time in assessing my situation, guiding me through the process with patience and expertise. and then like a ray of sunshine breaking through the clouds, came the news I had longed for – a new private key had been generated, restoring my precious bitcoins. It was a moment of jubilation, a triumph over adversity that filled me with newfound hope. At that moment, I realized the true power of Wizard Web Recovery, not just as skilled technicians, but as guardians of trust in the digital realm. With their assistance, I reclaimed what was rightfully mine, turning despair into determination and paving the way for a brighter future. But their capabilities did not end there. Delving deeper into their expertise, I discovered that Wizard Web Recovery possessed a wealth of knowledge in reclaiming lost stolen cryptocurrency, and even exposing fraudulent investment schemes. So to all those who find themselves entangled in the web of online fraud, take heart. With the guidance of Wizard Web Recovery, there is a path to redemption.     Write Mail; ( Wizard webrecovery AT  vprogrammer. net ) 
    • It all began with a chance encounter with a testimonial shared by Olivia, a fellow traveler on the winding road of cryptocurrency. Her words spoke of a miraculous recovery orchestrated by Wizard Web Recovery, a beacon of hope in the murky waters of online fraud. Intrigued by her story, I reached out to Wizard Web Recovery, hoping they could work their magic on my blocked crypto recovery. With bated breath, I shared my plight, providing evidence of my dilemma and praying for a solution. To my astonishment, a prompt response came, swift and reassuring. Wizard Web Recovery wasted no time in assessing my situation, guiding me through the process with patience and expertise. and then like a ray of sunshine breaking through the clouds, came the news I had longed for – a new private key had been generated, restoring my precious bitcoins. It was a moment of jubilation, a triumph over adversity that filled me with newfound hope. At that moment, I realized the true power of Wizard Web Recovery, not just as skilled technicians, but as guardians of trust in the digital realm. With their assistance, I reclaimed what was rightfully mine, turning despair into determination and paving the way for a brighter future. But their capabilities did not end there. Delving deeper into their expertise, I discovered that Wizard Web Recovery possessed a wealth of knowledge in reclaiming lost stolen cryptocurrency, and even exposing fraudulent investment schemes. So to all those who find themselves entangled in the web of online fraud, take heart. With the guidance of Wizard Web Recovery, there is a path to redemption.    
    • How can I add drops when killing an entity? Now there are no drops. How can I add an @override to change the attack speed to 1.6 and show "when in main hand...attack damage,...attack speed"? also, how can I make the item enchantable? 
    • Ok. Thanks. by the way, will this crash in any circumstances? public boolean onLeftClickEntity(ItemStack stack, Player player, Entity entity) { if (entity instanceof LivingEntity){ LivingEntity victim = (LivingEntity) entity; if(!victim.isDeadOrDying() && victim.getHealth()>0){ victim.setHealth(0); return true; } } return false; }  
    • You shouldn't be extracting the mod .jar, just place it in your mods folder.
  • Topics

×
×
  • Create New...

Important Information

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