Jump to content

Recommended Posts

Posted

I only use this way to make crafting recipes:

 

//Blaze Hammer
	GameRegistry.addRecipe(new ItemStack (MAItems.BlazeHammer),
			new Object [] {
					"BBB",
					"BAB",
					" A ",
					'A', Items.fire_charge,
					'B', Items.blaze_rod
					});

 

(As an example)

 

Is there a way so I can craft items using their ItemID's, I need this for spawn eggs because the metadata is a long process to find out.

Posted

Use string names for the spawners.

Also get rid of the 'new Object[]{}' stuff.

And no, you should never use IDs.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Not spawners I mean spawn eggs, I'm using it like this:

 

GameRegistry.addRecipe(new ItemStack (Items.spawn_egg, 1, 383),
			new Object [] {
					"  A",
					"  A",
					"  A",
					'A', Items.diamond,
	});

 

And so far have found most but not all the spawner eggs numbering, this is probably the worst way to do this, if so what way should I bet doing it for the eggs?

Posted

Is there no way to craft using item ids? since one egg is 383:50 and another 383:51, etc? Also I went through a lot of trial and error (to find the eggs) going like this:

 

//GameRegistry.addRecipe(new ItemStack (Items.spawn_egg, 1, 90), 			Spawn Egg - 'Spawn Pig'
	//GameRegistry.addRecipe(new ItemStack (Items.spawn_egg, 1, 91), 			Spawn Egg - 'Spawn Sheep'

 

And now I'm on "(Items.spawn_egg,1, 427)," and still haven't found them all xD

Posted

Stop, just stop.

This isn't hard.

Your result is a itemstack with a NBT string set to the entity name

So make that item stack.

Then make your recipe using that stack as the result.

Learn how objects work and how variables work before copy/pasting code.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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