Help With Code

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
So I'm trying to add recipes for spawn eggs into minecraft but I can't quite get the code
If someone could tell me how to do one or two I'm sure I could figure out how to do the rest but the again maybe not...
So far I have:
Code:
GameRegistry.addRecipe(new ItemStack(Block or Item.eggPig, 1), new Object []{"###", "#E#", "###", '#', Item.porkchop, 'E', Item.egg});
For some reason I feel I have several things wrong with this for example:
I feel like its going to have to deal with metadata or something? And egg might be a block idk
Please help :)
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
Well first, you should definitely replace those number signs with actual numbers.
What?
They're there used as a for lack of a better word place holder...
Say I want to make a coal block recipe right?
I do all that stuff up there but when I set the actual recipe it will look like this {"###", "###", "###", '#', Item.coal});
You can put anything in place of the # signs or leave it as is. I have no idea what you are talking about lol
 
  • Like
Reactions: Chocorate

power crystals

New Member
Jul 29, 2019
156
0
0
I'm pretty sure the spawn egg is some silly thing like "monster placer", but the individual mobs are not members of Item - they are damage values of the egg item (like dyes) where the damage value is the mob ID. You'll need to make a new ItemStack using something like EntityList.classToIDMapping to figure out what the damage should be. There might be an easier way I can't think of offhand, but that should work.
 
  • Like
Reactions: OmegaPython

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
I'm pretty sure the spawn egg is some silly thing like "monster placer", but the individual mobs are not members of Item - they are damage values of the egg item (like dyes) where the damage value is the mob ID. You'll need to make a new ItemStack using something like EntityList.classToIDMapping to figure out what the damage should be. There might be an easier way I can't think of offhand, but that should work.
X_X
Thanks for the help clearly harder than I thought LOL
Edit: Also you love your mods :)
 

CrafterOfMines57

New Member
Jul 29, 2019
275
0
0
I looked into it last night, and as power crystals said, it needs to be Item.monsterPlacer, although from there I don't know what to do. For some reason, EntityList.classToIDMapping is private when the rest of the fields are public, so using EntityList.IDtoClassMapping I believe the Entity ID of pigs to be 44, but so far my attempts to add a recipe into the game using that as either a damage value, or making a new ItemMonsterPlacer() with some creative casting have failed.
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
I looked into it last night, and as power crystals said, it needs to be Item.monsterPlacer, although from there I don't know what to do. For some reason, EntityList.classToIDMapping is private when the rest of the fields are public, so using EntityList.IDtoClassMapping I believe the Entity ID of pigs to be 44, but so far my attempts to add a recipe into the game using that as either a damage value, or making a new ItemMonsterPlacer() with some creative casting have failed.
Don't worry about it.
I have decdied to quit trying to make these eggs because in hindsight it's quite OP
Which is someting as you know that i hate ;)
Also do these seem fair for CD recipes?

GameRegistry.addRecipe(new ItemStack(Item.expBottle, 1), new Object []{"DED", "EBE", "DED", 'D', Block.blockDiamond, 'E', Block.blockEmerald, 'B', Item.glassBottle});
GameRegistry.addRecipe(new ItemStack(Item.expBottle, 1), new Object []{"EDE", "DBD", "EDE", 'D', Block.blockDiamond, 'E', Block.blockEmerald, 'B', Item.glassBottle});
GameRegistry.addRecipe(new ItemStack(Item.netherStar, 1), new Object []{"###", "#B#", "###", '#', Block.blockDiamond, 'B', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.dragonEgg, 1), new Object []{"BBB", "BEB", "BBB", 'B', Block.bedrock, 'E', Item.enderPearl});
GameRegistry.addShapelessRecipe(new ItemStack(Block.bedrock, 4), new Object []{Block.blockGold, Block.blockIron, Block.blockLapis, Block.blockDiamond, Block.blockEmerald, CoalBlock, Block.blockRedstone, Block.obsidian, Block.blockNetherQuartz});
GameRegistry.addRecipe(new ItemStack(Block.portal, 1), new Object []{"NBN", "BEB", "NBN", 'N', Block.netherrack, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.portal, 1), new Object []{"BNB", "NEN", "BNB", 'N', Block.netherrack, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.endPortal, 1), new Object []{"SBS", "BEB", "SBS", 'S', Block.whiteStone, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.endPortal, 1), new Object []{"BSB", "SES", "BSB", 'S', Block.whiteStone, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.endPortalFrame, 1), new Object []{"DED", "#E#", "###", '#', Block.whiteStone, 'E', Item.eyeOfEnder, 'D', Block.blockDiamond});
GameRegistry.addRecipe(new ItemStack(Block.commandBlock, 1), new Object []{"###", "#B#", "###", '#', Block.planks, 'B', Block.beacon});

GameRegistry.addRecipe(new ItemStack(Item.record13, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.endPortal});
GameRegistry.addRecipe(new ItemStack(Item.recordCat, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#',Block.blockEmerald});
GameRegistry.addRecipe(new ItemStack(Item.recordBlocks, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.commandBlock});
GameRegistry.addRecipe(new ItemStack(Item.recordChirp, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.portal});
GameRegistry.addRecipe(new ItemStack(Item.recordFar, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.bedrock});
GameRegistry.addRecipe(new ItemStack(Item.recordMall, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockDiamond});
GameRegistry.addRecipe(new ItemStack(Item.recordMellohi, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.beacon});
GameRegistry.addRecipe(new ItemStack(Item.recordStal, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.dragonEgg});
GameRegistry.addRecipe(new ItemStack(Item.recordStrad, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.ghastTear});
GameRegistry.addRecipe(new ItemStack(Item.recordWard, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Item.record11, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.netherStar});
GameRegistry.addRecipe(new ItemStack(Item.recordWait, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.endPortalFrame});
 

DWLooney

New Member
Jul 29, 2019
86
0
0
Nice to see a modder with a sense of hum
Don't worry about it.
I have decdied to quit trying to make these eggs because in hindsight it's quite OP
Which is someting as you know that i hate ;)
Also do these seem fair for CD recipes?

GameRegistry.addRecipe(new ItemStack(Item.expBottle, 1), new Object []{"DED", "EBE", "DED", 'D', Block.blockDiamond, 'E', Block.blockEmerald, 'B', Item.glassBottle});
GameRegistry.addRecipe(new ItemStack(Item.expBottle, 1), new Object []{"EDE", "DBD", "EDE", 'D', Block.blockDiamond, 'E', Block.blockEmerald, 'B', Item.glassBottle});
GameRegistry.addRecipe(new ItemStack(Item.netherStar, 1), new Object []{"###", "#B#", "###", '#', Block.blockDiamond, 'B', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.dragonEgg, 1), new Object []{"BBB", "BEB", "BBB", 'B', Block.bedrock, 'E', Item.enderPearl});
GameRegistry.addShapelessRecipe(new ItemStack(Block.bedrock, 4), new Object []{Block.blockGold, Block.blockIron, Block.blockLapis, Block.blockDiamond, Block.blockEmerald, CoalBlock, Block.blockRedstone, Block.obsidian, Block.blockNetherQuartz});
GameRegistry.addRecipe(new ItemStack(Block.portal, 1), new Object []{"NBN", "BEB", "NBN", 'N', Block.netherrack, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.portal, 1), new Object []{"BNB", "NEN", "BNB", 'N', Block.netherrack, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.endPortal, 1), new Object []{"SBS", "BEB", "SBS", 'S', Block.whiteStone, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.endPortal, 1), new Object []{"BSB", "SES", "BSB", 'S', Block.whiteStone, 'B', Block.bedrock, 'E', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Block.endPortalFrame, 1), new Object []{"DED", "#E#", "###", '#', Block.whiteStone, 'E', Item.eyeOfEnder, 'D', Block.blockDiamond});
GameRegistry.addRecipe(new ItemStack(Block.commandBlock, 1), new Object []{"###", "#B#", "###", '#', Block.planks, 'B', Block.beacon});

GameRegistry.addRecipe(new ItemStack(Item.record13, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.endPortal});
GameRegistry.addRecipe(new ItemStack(Item.recordCat, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#',Block.blockEmerald});
GameRegistry.addRecipe(new ItemStack(Item.recordBlocks, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.commandBlock});
GameRegistry.addRecipe(new ItemStack(Item.recordChirp, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.portal});
GameRegistry.addRecipe(new ItemStack(Item.recordFar, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.bedrock});
GameRegistry.addRecipe(new ItemStack(Item.recordMall, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.blockDiamond});
GameRegistry.addRecipe(new ItemStack(Item.recordMellohi, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.beacon});
GameRegistry.addRecipe(new ItemStack(Item.recordStal, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.dragonEgg});
GameRegistry.addRecipe(new ItemStack(Item.recordStrad, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.ghastTear});
GameRegistry.addRecipe(new ItemStack(Item.recordWard, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.expBottle});
GameRegistry.addRecipe(new ItemStack(Item.record11, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Item.netherStar});
GameRegistry.addRecipe(new ItemStack(Item.recordWait, 1), new Object []{"OOO", "O#O", "OOO", "O", Block.obsidian, '#', Block.endPortalFrame});
Nice to see a modder around with a sense of humor :)
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
Nice to see a modder with a sense of hum

Nice to see a modder around with a sense of humor :)
o_O that seems familiar. Almost like the exact same thing I posted on the IC2 GregTech thread yesterday.
Also those are serious LOL
What's wrong with them?
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
What's your mod going to be called? RecipiesForStuffThereShouldBeNoRecipiesFor?

You know that your mod isn't actually adding content right? You're just adding an alternative to NEI in cheatmode.
 

ILoveGregTech

New Member
Jul 29, 2019
788
0
0
What's your mod going to be called? RecipiesForStuffThereShouldBeNoRecipiesFor?

You know that your mod isn't actually adding content right? You're just adding an alternative to NEI in cheatmode.
I would hardly call using lots of resources cheat mode and actually I have added stuff.. Check it out