Jump to content

Recommended Posts

Posted

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});

Posted

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...

Posted

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}++;

Posted

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.

Posted

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.

Posted

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[]

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



×
×
  • Create New...

Important Information

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