Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

[Forge] Mob Spawning Egg Name? (How add?)

egg spawn mob

  • Please log in to reply
9 replies to this topic

#1

jonilo5_five
  • Location: Sweden

Posted 11 January 2013 - 08:12 PM

I am a new modder and dont know many things about modding get, but I have made a few things.
I need help to just add a few names to the spawn egg to the "new mobs"
Posted Image
Posted Image
Posted Image
Pic's of the problem!


Just need a code to add a name to them

my code mod_Mob
Spoiler:


Register or log in to remove.

#2

jonilo5_five
  • Location: Sweden

Posted 11 January 2013 - 10:53 PM

Anyone? the code to add a new name to the eggs?

#3

Hyena_Of_Doom

Posted 11 January 2013 - 11:31 PM

The code you need is:-

LanguageRegistry.instance().addStringLocalization("entity.YOURMOD.YOURMOB.name", "YOUR MOB NAME");

you already have it in there for one of your mobs but you need one for each of them. for example for the "Red Creeper" mob you would put:-

LanguageRegistry.instance().addStringLocalization("entity.mod_Mob.Red Creeper.name", "Red Creeper");


#4

jonilo5_five
  • Location: Sweden

Posted 12 January 2013 - 12:13 AM

View PostHyena_Of_Doom, on 11 January 2013 - 11:31 PM, said:

The code you need is:-

LanguageRegistry.instance().addStringLocalization("entity.YOURMOD.YOURMOB.name", "YOUR MOB NAME");

you already have it in there for one of your mobs but you need one for each of them. for example for the "Red Creeper" mob you would put:-

LanguageRegistry.instance().addStringLocalization("entity.mod_Mob.Red Creeper.name", "Red Creeper");


Oh thanks! i dont remember if my code worked. Buton the morning when i turn on my computer then i can test and see.
Thanks again :)

#5

jonilo5_five
  • Location: Sweden

Posted 12 January 2013 - 02:21 PM

It didnt work :(

#6

Hyena_Of_Doom

Posted 12 January 2013 - 08:44 PM

Really? can you show me where you're putting it in the code?

#7

jonilo5_five
  • Location: Sweden

Posted 13 January 2013 - 10:40 AM

View PostHyena_Of_Doom, on 12 January 2013 - 08:44 PM, said:

Really? can you show me where you're putting it in the code?
sure
(the blue is the added code)
Spoiler:


#8

Hyena_Of_Doom

Posted 13 January 2013 - 11:14 AM

ok i think I see whats going on here, in:-
LanguageRegistry.instance().addStringLocalization("entity.YOURMOD.YOURMOB.name", "YOUR MOB NAME");

the YOURMOD needs to be the base name of your mod,if you really are using forge (I say this as your using a lot of the old modloader methods) then in the main file there should be a line like this:-
@Mod(modid="[i]YOURMOD[/i]", name="[i]YOUR MOD READABLE NAME[/i]", version="[i]YOURMOD_VERSIONNUMBER[/i]")

the modID YOURMOD is what you need in the  Language Registry line. usually the mob resistory would be in the @Init of the main mod file (the Load method) so without seeing it I assume its beeing called from there.


the only Other thing I can say is that if you are using forge as you say you are then you really should use forge methods to create your mob rather than modloader ones as those are just in there for compatibility with older mods (this is what everyone has said to me while I was learning how to add a mob). I'll give an working example directly out of the mod I'm working on here for one of my mobs:-

EntityRegistry.registerModEntity(EntityHyena.class, "Hyena", 1, this, 80, 3, true);
EntityRegistry.addSpawn(EntityHyena.class, 5, 4, 8, EnumCreatureType.creature,  BiomeGenBase.jungle, BiomeGenBase.desert, BiomeGenBase.plains);
LanguageRegistry.instance().addStringLocalization("entity.lifePP.Hyena.name", "Hyena");
 registerEntityEgg(EntityHyena.class, 0xCC9E1F, 0x574103);
RenderingRegistry.registerEntityRenderingHandler(EntityHyena.class, new RenderHyena(new ModelHyena(),0.4F)); 

this should be all you need in the main file to put a mob into the game (If you would like me to explain how to edit this code for your mob let me know).

#9

jonilo5_five
  • Location: Sweden

Posted 13 January 2013 - 01:37 PM

I have no idea how to fix this (new modder Posted Image )

what do you mean here?
"the YOURMOD needs to be the base name of your mod"

Is there any video that you can send Posted Image?

And there are som Forge files i have found in eclipse. (and I remember adding the thing so Forge was added)

#10

Hyena_Of_Doom

Posted 13 January 2013 - 01:58 PM

basicly in that line where I've put the word "YOURMOD" you need to put your mod ID.

I would suggest looking at the tutorials here:- http://wuppy29.blogs...odding-142.html

this guys done both text and video tutorials for creating mobs. look at the sections on Entities there, you might also want to look at the basic mod setup there to get your mod using fully forge methods. these are what I used to learn minecraft modding and their very helpfull.