Tried that, throws a null pointer exception. I tried setting throwEntityID to the id of throwingRock in my mod (and then deleting ++) that didn't work either. Also tried changing the name to "throwingRock" as that's the unlocalized name I use, with both above configurations, no luck.
As for the code in "new RenderSnowball(...))" I just meant that you don't have to use your mod instance as a prefix for the item, but I do. Was just curious if you used a local variable within ClientProxy to pass the item as an argument. To clarify, you use (sunlight) and not (YourModName.sunlight), whereas I use (SimpleWands.throwingRock).
EDIT: Looking through the code for registerModEntity, I see " * @param entityName A unique name for the entity" and it occurs to me that I never name the Entity, only the Item (aside, of course, from the class name). Am I supposed to set a name for it somewhere, like setUnlocalizedName for Items?
And why choose '5' for the throwEntityID? Sorry, I'm not really sure what ID value I should be using here. I tried using "EntityRegistry.findGlobalUniqueEntityId()" but that didn't resolve the null pointer exception.
Don't know if it makes a difference, but that code is in my main mod class (inside the 'public void init(...)' method)
Don't know if it makes a difference, but that code is in my main mod class (inside the 'public void init(...)' method)
Are you using 1.6.x? In my main class, I only have preInit(), load(), and postInit().
However, I put it in load() and... it worked!?! No null pointer exception AND I can check if world is remote and my object will still render, AND I can use a custom renderer, not just renderSnowball. Thanks a ton Country_Gamer!
I've still got a few questions, if you don't mind: Never mind, I answered them myself
- I had my register entities and renderers in ClientProxy before, since that has a function "registerRenderers();" but obviously they weren't working correctly there; what is that for, then?
SOLVED: It's still for registering renderers and entities, see below.
- Could the problem be in "registerModEntity(...)" - we need to pass the mod, "this", but that can't be done correctly from outside of the main mod class, right?
SOLVED: Yes, this is the problem. Instead of "this", you have to use yourModName.instance.
- Any protocols on choosing throwEntityID, or can any be used?
SOLVED: I put in "EntityRegistry.findGlobalUniqueEntityId()" instead and it works fine, so I guess I'll use that to be on the safe side.
Here's what the final code looks like, in ClientProxy, NOT the main mod class:
Are you using 1.6.x? In my main class, I only have preInit(), load(), and postInit().
However, I put it in load() and... it worked!?! No null pointer exception AND I can check if world is remote and my object will still render, AND I can use a custom renderer, not just renderSnowball. Thanks a ton Country_Gamer!
I've still got a few questions, if you don't mind: Never mind, I answered them myself
- I had my register entities and renderers in ClientProxy before, since that has a function "registerRenderers();" but obviously they weren't working correctly there; what is that for, then?
SOLVED: It's still for registering renderers and entities, see below.
- Could the problem be in "registerModEntity(...)" - we need to pass the mod, "this", but that can't be done correctly from outside of the main mod class, right?
SOLVED: Yes, this is the problem. Instead of "this", you have to use yourModName.instance.
- Any protocols on choosing throwEntityID, or can any be used?
SOLVED: I put in "EntityRegistry.findGlobalUniqueEntityId()" instead and it works fine, so I guess I'll use that to be on the safe side.
Here's what the final code looks like, in ClientProxy, NOT the main mod class:
You are welcome. Btw, @PreInit, @Init, and @PostInit are all now @EventHandler
Yeah, I was referring to the function names rather than the @handle, but thanks! Don't know if you saw, but I was able to get it to work in ClientProxy by changing "this" to "ModName.instance". That way you can keep the main mod instance a bit cleaner
This will cover some tutorials that I know I couldnt find decent ones for 1.5.2. If you are having any trouble with something, let me know, and I will see if I can work it out at post the tutorial.
1.5.2
Mobs
Main class:
public static int startEntityId = 300;
public static int mobID = 0;
public static int primaryColor = 0x047A14;
@Init
public void init(FMLInitializationEvent event) {
EntityRegistry.registerGlobalEntityID(EntityYOURMOB.class, "YourMob", ++mobID);
EntityRegistry.addSpawn(EntityYOURMOB.class, /*how common*/1, /*entity per group min*/1, /*max*/4, EnumCreatureType.creature);
EntityRegistry.findGlobalUniqueEntityId();
registerEntityEgg(EntityYOURMOB.class, primaryColor, 0xBD6100);
RenderingRegistry.registerEntityRenderingHandler(EntityYOURMOB.class, new RenderYOURMOB(new ModelYOURMOB(), 0.3F));
LanguageRegistry.instance().addStringLocalization("entity.YourMob.name", "Your Mob");
}
public static void registerEntityEgg(Class <? extends Entity> entity, int primaryColor, int secondaryColor) {
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}
public static int getUniqueEntityId() {
do {
startEntityId++;
}
while (EntityList.getStringFromID(startEntityId) != null);
return startEntityId;
}
In the @Init method, you need to register the mob's id and it's name. The ID (in this case) comes from the class's base mod id (mobID), which is initally set to 0. You put an increase counter so that your first mob's id is now 1. If you copy this code, the next would be 2, and so forth. The string is the name, which is registered as "entity.inputString.name", we set it as "entity.YourMob.name".
You add the spawn so that forge knows to spawn the entity. This also declares the type of the mob (creature, hostile, animal, etc).
You need to find the global entity id, just because.
Next you register the egg, with its colors as well.
Next you link the entity, its renderer and its model.
Then you change the name so that "entity.YourMob.name" is now "Your Mob".
Entity Class
public class EntityYOURMOB extends EntityGolem {
private String texture;
public EntityYOURMOB(World world) {
super(world);
this.moveSpeed = 1.0F;
this.setSize(1.0F, 0.5F);
//AI
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(2, new EntityAILookIdle(this));
this.texture = "/mods/YOURMODID/textures/mobs/YOURMOBTEXTURE.png";
}
public boolean isAIEnabled() { return true; }
public String getTexture() { return texture; }
//protected String getLivingSound() { return "mob.cow.say"; }
//protected String getHurtSound() { return "mob.cow.hurt"; }
protected String getDeathSound() { return "mob.cow.hurt"; }
public int getMaxHealth() { return 6; }
}
This is just some basic entity code. You can get more methods by looking around some of the other entity files. Just for example, I have mobs that dont move and that can shoots projectiles like the snowman.
The extends EntityGolem can be a variety of Entity classes, just browse around an find something you like.
This is basic render stuff. Nothing important. Just make sure all the ModelClass and EntityClass references are correct
Model Class
Use techne to model your mob. When you export the java and texture map, import the java code to your ModelYOURMOB class (replacing all eclipse generated text). You should get package, class name, and a buttload of others. Fix the package and class name, and then import all the required resources. You will be left with one error under the setRotationAngles. You can comment out any code within that method, but you must keep the method.
That should be all. If you have any problems, just post below. I will get the notification.
Installing 1.5.2 mods for the new 1.6.1 launcher (v1.0.8+)
Create a new version to run forge off of
This includes:
1) downloading the 1.5.2 release inside the new launcher
2) locate your [minecraft] folder
3) navigate to versions which is inside the mc folder
4) copy the folder named "1.5.2" and rename the copied folder to "Forge_1.5.2"
5) go inside the new folder named "Forge_1.5.2"
6) rename the jar labeled "1.5.2" and rename it to "Forge_1.5.2"
7) do the same for the .json file
8) open the .json file with a text editor (I use notepad++)
9) Change
"id": "1.5.2",
to
"id": "Forge_1.5.2",
10) Download FORGE 1.5.2 release (http://adf.ly/673885...2-7.8.1.738.zip) (this came from files.minecraftforge.net) NOTE: following steps are installing forge into the minecraft jar, excepting instead of minecraft.jar, you are using the Forge_1.5.2.jar
11) open the Forge_1.5.2.jar with WinRAR or acceptable program
12) open the universal forge zip file that was just downloaded with WinRAR or acceptable program
13) delete the META-INF in the Forge_1.5.2.jar
14) copy all contents of the forge zip to the Forge_1.5.2.jar
15) close all windows except for the [minecraft] folder window
16) run the new launcher, and use the new "Forge_1.5.2" release we just created
17) after running the game successfully, you will have a 'mods' folder in your [minecraft] folder
18) put any compatible mods into the mods folder, and run mc. The mods should successfully run. NOTE: As of right now, you will have to manually change what mods are running with forge. All mods in the mods folder WILL be loaded by forge if you play mc forge in game. If you have two separate versions (1.5.2 forge and 1.6.1 forge) you will have to manually change the mods. NOTE 2: I plan on creating at least a mac application script to do this for me, so if you want to get a hold of it, let me know!
Adding Labels above Mobs/Entities
Adding Labels above Blocks (Requires a Tile Entity)
Add this do you doRender method in your Render class (your block needs a tile entity) This code goes in the renderAModelAt method
RenderYOURLABEL.renderLabel(tileEnt, "Your Label Text", 100, x, y, z, 20, 2);
Where par1 is the tile entity, par2 is the text to be displayed, par3 is the distance from the block at which the player can see the label, par4 par5 and par6 are the corrdinates of the block, par7 is the length of the label, and par 8 is how many lines the label is.
Note that you can put "\n" in your label to represent a line breeak.
1.6.1/1.6.2 Updating Mods from 1.5.2 to 1.6.1/1.6.2
A whole buttload of things. Will be adding as i fix my mods Items and Blocks:
A good tutorial i found is here (by The34ry):http://www.minecraft...raft-forge-162/
Entity Textures/Renders:
A very helpful tutorial can be found here: http://www.minecraft...initialization/
I cannot make it any simpler. If you have any questions, post it!
notes:
- the function name will be changed later as forge makes re-adjustments
Particle Effects:
When I do Particle Effects (in 1.5.2) i used a RenderEngine class import. This class has been changed to TextureManager. This should take care of the error
First, if your Eclipse project gives you NO errors:
Exit eclipse.
Next we will do the normal stuff.
Run the recompile.sh (or recompile.bat) that is in your mcp folder (inside forge folder)
After running this, decide whether you have classes from the basic minecraft. These classes are classes that were there when you decompiled or installed forge. There are two different reobf programs. One is 'reobfuscate_srg.sh(.bat)' and the other is 'reobfuscate.sh(.bat)'. If you HAVE NOT editted base classes, run the _srg file. If you DO HAVE editted base classes, run the normal reobj program.
Both of these will export your code to the reobj folder inside the mcp folder.
Go into your SRC folder. go through till you find the assets folder. If you have an mcmod.info file, it will be here while testing in eclipse. COPY all of these.
Now go into the reobf folder that was just created, and find where it outputted your code. It will have the mods folder sitting there for you. PASTE the assets/mcmod.info stuff right here.
Next, package your assets folder, mods folder, and mcmod.info file into one .zip file. The directory should now look like this:
forge -> mcp -> reobf -> minecraft ;
mods -> your compiled classes
assets -> your textures
mcmod.info
YOURCOMPRESSEDMOD.zip
You can name the .zip whatever pleases you. I like to name mine 'CountryGamer_' and then what ever the mod is. Of course, this must end with a .zip extension.
After doing all of this, people with no editted base classes are done.
If you HAVE editted base classes, make sure you package your custom code and your editted code in two different .zip files. One will be the file that the player will unpack into the .jar file, and the other will be any classes you made, along with your textures and mcmod.info file.
For everyone: these .zip folders go into your mods folder after the player has successfully run minecraft with FORGE installed! Horray!!!
Notes:
This was taken care of in the update to 1.6.2 i do believe
how come there is nothing under the spoiler "Creating an mcmod.info file:"?
Rollback Post to RevisionRollBack
For those who need to contact me my email is [email protected] and Skype OrionTheConstilation
thanks also I don't understand any of this, how do we make a mod for 1.6.2?
This isn't really a 'lets makes a mod' series. It is more geared for updating to 1.6.2, and adding things that I didn't find any good tutorials on. There were some things that I had to find out myself, and I felt like giving those resources for others
This isn't really a 'lets makes a mod' series. It is more geared for updating to 1.6.2, and adding things that I didn't find any good tutorials on. There were some things that I had to find out myself, and I felt like giving those resources for others
okay so I should go somewhere else to learn how to make a 1.6.2 mod?
Rollback Post to RevisionRollBack
For those who need to contact me my email is [email protected] and Skype OrionTheConstilation
okay so I should go somewhere else to learn how to make a 1.6.2 mod?
For basic blocks, items, and suck other things, yes. Because those are simple and there are many tutorials of them. I like to keep this for the more complex feel free to pm me or post here if you have any problems though!
Ah, Country_Gamer you were right about another thing I found this thread discussing Mod Entities vs Global Entities, and it's much better to use Mod Entities like you did when you registered your entities. It works fine registering this way within ClientProxy. Thanks again for your help.
For projectiles, common values are 10 or 20. At 1, I was experiencing some strange behavior, the trajectory looking a little off and not colliding with entities sometimes. It seems to work now with a higher update frequency.
I am assuming you are using mc 1.6.2 because you have an assets folder.
If this is true, look under my tutorial on 1.6.2 mob textures! (Creating a ResourceLocation and referencing it in the RenderYOURMOB class)
I am assuming you are using mc 1.6.2 because you have an assets folder.
If this is true, look under my tutorial on 1.6.2 mob textures! (Creating a ResourceLocation and referencing it in the RenderYOURMOB class)
Ok well I want to use ModelBiped can I use that without creating a Render and Model class and still use my custom texture?
Hey, I had copied the code for 1.5.2 into my mod but the mob wont appear, I can hear it, just can't see it.
Here is the code for main class:
public static int startEntityId = 300;
public static int mobID = 100;
public static int primaryColor = 0x047A14;
public static void registerEntityEgg(Class entity, int primaryColor, int secondaryColor) {
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}
public static int getUniqueEntityId() {
do {
startEntityId++;
}
while (EntityList.getStringFromID(startEntityId) != null);
return startEntityId;
}
//Declaring Init
@Init
public void init(FMLInitializationEvent event){
EntityRegistry.registerGlobalEntityID(EntitySatyr.class, "Satyr", ++mobID);
EntityRegistry.addSpawn(EntitySatyr.class, /*how common*/90, /*entity per group min*/1, /*max*/4, EnumCreatureType.creature);
EntityRegistry.findGlobalUniqueEntityId();
registerEntityEgg(EntitySatyr.class, primaryColor, 0xBD6100);
RenderingRegistry.registerEntityRenderingHandler(EntitySatyr.class, new RenderSatyr(new SatyrModel(), 0.3F));
LanguageRegistry.instance().addStringLocalization("Satyr", "Satyr");
public class EntitySatyr extends EntityLiving
{
public EntitySatyr(World world)
{
super(world);
this.moveSpeed = 1.0F;
this.setSize(1.0F, 0.5F);
//AI
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(2, new EntityAILookIdle(this));
this.texture = "/Graecus/GraecusRomanus/textures/mobs/mod_satyr.png";
}
public boolean isAIEnabled() { return true; }
public String getTexture() { return texture; }
public int getMaxHealth()
{
return 10;
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return "mob.sheep.say";
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.cow.hurt";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.cow.hurt";
}
/**
* Plays step sound at given x, y, z for the entity
*/
protected void playStepSound(int par1, int par2, int par3, int par4)
{
this.playSound("mob.cow.step", 0.15F, 1.0F);
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 0.4F;
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return Item.leather.itemID;
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void dropFewItems(boolean par1, int par2)
{
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(Item.leather.itemID, 1);
}
for (k = 0; k < j; ++k)
{
if (this.isBurning())
{
this.dropItem(Item.beefCooked.itemID, 1);
}
else
{
this.dropItem(Item.beefRaw.itemID, 1);
}
}
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.bucketEmpty.itemID)
{
if (--itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk));
}
else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk)))
{
par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0));
}
public class ClientProxy extends CommonProxy{
@Override
public void registerRenderers() {
RenderingRegistry.registerEntityRenderingHandler(EntitySatyr.class, new RenderSatyr(new SatyrModel(), 0.5F));
}
}
Also here is the Console Log:
2014-04-23 20:39:06 [INFO] [ForgeModLoader] Forge Mod Loader version 5.2.2.684 for Minecraft 1.5.2 loading
2014-04-23 20:39:06 [INFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_51, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
2014-04-23 20:39:06 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2014-04-23 20:39:09 [INFO] [STDOUT] 229 recipes
2014-04-23 20:39:09 [INFO] [STDOUT] 27 achievements
2014-04-23 20:39:09 [INFO] [Minecraft-Client] Setting user: Player582
2014-04-23 20:39:09 [INFO] [STDOUT] (Session ID is -)
2014-04-23 20:39:09 [INFO] [STDERR] Client asked for parameter: server
2014-04-23 20:39:09 [INFO] [Minecraft-Client] LWJGL Version: 2.4.2
2014-04-23 20:39:09 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
2014-04-23 20:39:09 [INFO] [STDOUT] MinecraftForge v7.8.0.684 Initialized
2014-04-23 20:39:09 [INFO] [ForgeModLoader] MinecraftForge v7.8.0.684 Initialized
2014-04-23 20:39:09 [INFO] [STDOUT] Replaced 85 ore recipies
2014-04-23 20:39:09 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
2014-04-23 20:39:10 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Ryan\Desktop\Greek-Roman Mod\jars\config\logging.properties
2014-04-23 20:39:10 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2014-04-23 20:39:10 [INFO] [ForgeModLoader] Searching C:\Users\Ryan\Desktop\Greek-Roman Mod\jars\mods for mods
2014-04-23 20:39:11 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2014-04-23 20:39:11 [INFO] [mcp] Activating mod mcp
2014-04-23 20:39:11 [INFO] [FML] Activating mod FML
2014-04-23 20:39:11 [INFO] [Forge] Activating mod Forge
2014-04-23 20:39:11 [INFO] [GraecusRomanus] Activating mod GraecusRomanus
2014-04-23 20:39:11 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2014-04-23 20:39:11 [INFO] [STDOUT]
2014-04-23 20:39:11 [INFO] [STDOUT] Starting up SoundSystem...
2014-04-23 20:39:11 [INFO] [STDOUT] Initializing LWJGL OpenAL
2014-04-23 20:39:11 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2014-04-23 20:39:11 [INFO] [STDOUT] OpenAL initialized.
2014-04-23 20:39:12 [INFO] [STDOUT]
2014-04-23 20:39:12 [INFO] [STDERR] java.lang.NoSuchFieldException: GL_ARB_copy_image
2014-04-23 20:39:12 [INFO] [STDERR] at java.lang.Class.getField(Unknown Source)
2014-04-23 20:39:12 [INFO] [STDERR] at cpw.mods.fml.client.TextureFXManager.getHelper(TextureFXManager.java:122)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.renderer.texture.TextureStitched.init(TextureStitched.java:74)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:154)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:520)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:443)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:732)
2014-04-23 20:39:12 [INFO] [STDERR] at java.lang.Thread.run(Unknown Source)
2014-04-23 20:39:12 [INFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled
2014-04-23 20:39:12 [INFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-04-23 20:39:13 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-04-23 20:39:13 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-04-23 20:39:13 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-04-23 20:39:14 [INFO] [STDERR] Exception in thread "Thread-12" java.lang.IllegalArgumentException: input stream cannot be null
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96352_a(Request.java:94)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96364_c(Request.java:80)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96377_a(McoClient.java:198)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96375_b(McoClient.java:89)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.gui.ThreadTitleScreen.run(ThreadTitleScreen.java:39)
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-04-23 20:39:17 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2
2014-04-23 20:39:17 [INFO] [Minecraft-Server] Generating keypair
2014-04-23 20:39:18 [INFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@5f425b3b)
2014-04-23 20:39:18 [INFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@5f425b3b)
2014-04-23 20:39:18 [INFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@5f425b3b)
2014-04-23 20:39:18 [INFO] [Minecraft-Server] Preparing start region for level 0
2014-04-23 20:39:19 [INFO] [STDOUT] loading single player
2014-04-23 20:39:19 [INFO] [Minecraft-Server] Player582[/127.0.0.1:0] logged in with entity id 381 at (188.47269718354596, 64.0, 282.1806696411004)
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving and pausing game...
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Stopping server
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving players
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving worlds
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2014-04-23 20:39:29 [INFO] [ForgeModLoader] Unloading dimension 0
2014-04-23 20:39:29 [INFO] [ForgeModLoader] Unloading dimension -1
2014-04-23 20:39:29 [INFO] [ForgeModLoader] Unloading dimension 1
2014-04-23 20:39:31 [INFO] [Minecraft-Client] Stopping!
2014-04-23 20:39:31 [INFO] [STDOUT]
2014-04-23 20:39:31 [INFO] [STDOUT] SoundSystem shutting down...
2014-04-23 20:39:31 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
2014-04-23 20:39:31 [INFO] [STDOUT]
Don't know if it makes a difference, but that code is in my main mod class (inside the 'public void init(...)' method)
Are you using 1.6.x? In my main class, I only have preInit(), load(), and postInit().
However, I put it in load() and... it worked!?! No null pointer exception AND I can check if world is remote and my object will still render, AND I can use a custom renderer, not just renderSnowball. Thanks a ton Country_Gamer!
I've still got a few questions, if you don't mind:Never mind, I answered them myself- I had my register entities and renderers in ClientProxy before, since that has a function "registerRenderers();" but obviously they weren't working correctly there; what is that for, then?
SOLVED: It's still for registering renderers and entities, see below.
- Could the problem be in "registerModEntity(...)" - we need to pass the mod, "this", but that can't be done correctly from outside of the main mod class, right?
SOLVED: Yes, this is the problem. Instead of "this", you have to use yourModName.instance.
- Any protocols on choosing throwEntityID, or can any be used?
SOLVED: I put in "EntityRegistry.findGlobalUniqueEntityId()" instead and it works fine, so I guess I'll use that to be on the safe side.
Here's what the final code looks like, in ClientProxy, NOT the main mod class:
You are welcome. Btw, @PreInit, @Init, and @PostInit are all now @EventHandler
Yeah, I was referring to the function names rather than the @handle, but thanks! Don't know if you saw, but I was able to get it to work in ClientProxy by changing "this" to "ModName.instance". That way you can keep the main mod instance a bit cleaner
THE DOCTOR!!! Haha!
I guess I never put that one up haha. Guess I should do that ;D Sorry! Ill get right to it after I update my mod!
This isn't really a 'lets makes a mod' series. It is more geared for updating to 1.6.2, and adding things that I didn't find any good tutorials on. There were some things that I had to find out myself, and I felt like giving those resources for others
For basic blocks, items, and suck other things, yes. Because those are simple and there are many tutorials of them. I like to keep this for the more complex feel free to pm me or post here if you have any problems though!
One thing of note in that post is a great link to a reference chart for tracker update frequencies: https://docs.google.com/spreadsheet/pub?key=0Ap8gssssFFPAdFRXREZGSzZRY3k1WE8wcUE4S09xWXc&single=true&gid=0&output=html
For projectiles, common values are 10 or 20. At 1, I was experiencing some strange behavior, the trajectory looking a little off and not colliding with entities sometimes. It seems to work now with a higher update frequency.
The thread is here, for anyone (like me) who doesn't know: http://www.minecraft...0#entry18822284
Can you help?
I am assuming you are using mc 1.6.2 because you have an assets folder.
If this is true, look under my tutorial on 1.6.2 mob textures! (Creating a ResourceLocation and referencing it in the RenderYOURMOB class)
You could use the model, but you still need the render class for the texture I believe. Anyway, the Render class is the easy part!
Here is the code for main class:
public static int mobID = 100;
public static int primaryColor = 0x047A14;
public static void registerEntityEgg(Class entity, int primaryColor, int secondaryColor) {
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}
public static int getUniqueEntityId() {
do {
startEntityId++;
}
while (EntityList.getStringFromID(startEntityId) != null);
return startEntityId;
}
//Declaring Init
@Init
public void init(FMLInitializationEvent event){
EntityRegistry.registerGlobalEntityID(EntitySatyr.class, "Satyr", ++mobID);
EntityRegistry.addSpawn(EntitySatyr.class, /*how common*/90, /*entity per group min*/1, /*max*/4, EnumCreatureType.creature);
EntityRegistry.findGlobalUniqueEntityId();
registerEntityEgg(EntitySatyr.class, primaryColor, 0xBD6100);
RenderingRegistry.registerEntityRenderingHandler(EntitySatyr.class, new RenderSatyr(new SatyrModel(), 0.3F));
LanguageRegistry.instance().addStringLocalization("Satyr", "Satyr");
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class EntitySatyr extends EntityLiving
{
public EntitySatyr(World world)
{
super(world);
this.moveSpeed = 1.0F;
this.setSize(1.0F, 0.5F);
//AI
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(2, new EntityAILookIdle(this));
this.texture = "/Graecus/GraecusRomanus/textures/mobs/mod_satyr.png";
}
public boolean isAIEnabled() { return true; }
public String getTexture() { return texture; }
public int getMaxHealth()
{
return 10;
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return "mob.sheep.say";
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.cow.hurt";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.cow.hurt";
}
/**
* Plays step sound at given x, y, z for the entity
*/
protected void playStepSound(int par1, int par2, int par3, int par4)
{
this.playSound("mob.cow.step", 0.15F, 1.0F);
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 0.4F;
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return Item.leather.itemID;
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void dropFewItems(boolean par1, int par2)
{
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(Item.leather.itemID, 1);
}
j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2);
for (k = 0; k < j; ++k)
{
if (this.isBurning())
{
this.dropItem(Item.beefCooked.itemID, 1);
}
else
{
this.dropItem(Item.beefRaw.itemID, 1);
}
}
}
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.bucketEmpty.itemID)
{
if (--itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk));
}
else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk)))
{
par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0));
}
return true;
}
else
{
return super.interact(par1EntityPlayer);
}
}
}
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
@SideOnly(Side.CLIENT)
public class RenderSatyr extends RenderLiving
{
protected SatyrModel model;
public RenderSatyr(ModelBase par1ModelBase, float par2) {
super(par1ModelBase, par2);
model = ((SatyrModel)mainModel);
}
public void renderSatyr(EntitySatyr entity, double par2, double par4, double par6, float par8, float par9) {
super.doRenderLiving(entity, par2, par4, par6, par8, par9);
}
public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) {
renderSatyr((EntitySatyr)par1EntityLiving, par2, par4, par6, par8, par9);
}
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
renderSatyr((EntitySatyr)par1Entity, par2, par4, par6, par8, par9);
}
}
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraftforge.client.MinecraftForgeClient;
import Graecus.GraecusRomanus.CommonProxy;
import Graecus.GraecusRomanus.entities.mob.EntitySatyr;
import Graecus.GraecusRomanus.entities.mob.RenderSatyr;
import Graecus.GraecusRomanus.entities.mob.SatyrModel;
public class ClientProxy extends CommonProxy{
@Override
public void registerRenderers() {
RenderingRegistry.registerEntityRenderingHandler(EntitySatyr.class, new RenderSatyr(new SatyrModel(), 0.5F));
}
}
2014-04-23 20:39:06 [INFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_51, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
2014-04-23 20:39:06 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2014-04-23 20:39:09 [INFO] [STDOUT] 229 recipes
2014-04-23 20:39:09 [INFO] [STDOUT] 27 achievements
2014-04-23 20:39:09 [INFO] [Minecraft-Client] Setting user: Player582
2014-04-23 20:39:09 [INFO] [STDOUT] (Session ID is -)
2014-04-23 20:39:09 [INFO] [STDERR] Client asked for parameter: server
2014-04-23 20:39:09 [INFO] [Minecraft-Client] LWJGL Version: 2.4.2
2014-04-23 20:39:09 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
2014-04-23 20:39:09 [INFO] [STDOUT] MinecraftForge v7.8.0.684 Initialized
2014-04-23 20:39:09 [INFO] [ForgeModLoader] MinecraftForge v7.8.0.684 Initialized
2014-04-23 20:39:09 [INFO] [STDOUT] Replaced 85 ore recipies
2014-04-23 20:39:09 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
2014-04-23 20:39:10 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Ryan\Desktop\Greek-Roman Mod\jars\config\logging.properties
2014-04-23 20:39:10 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2014-04-23 20:39:10 [INFO] [ForgeModLoader] Searching C:\Users\Ryan\Desktop\Greek-Roman Mod\jars\mods for mods
2014-04-23 20:39:11 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2014-04-23 20:39:11 [INFO] [mcp] Activating mod mcp
2014-04-23 20:39:11 [INFO] [FML] Activating mod FML
2014-04-23 20:39:11 [INFO] [Forge] Activating mod Forge
2014-04-23 20:39:11 [INFO] [GraecusRomanus] Activating mod GraecusRomanus
2014-04-23 20:39:11 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2014-04-23 20:39:11 [INFO] [STDOUT]
2014-04-23 20:39:11 [INFO] [STDOUT] Starting up SoundSystem...
2014-04-23 20:39:11 [INFO] [STDOUT] Initializing LWJGL OpenAL
2014-04-23 20:39:11 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
2014-04-23 20:39:11 [INFO] [STDOUT] OpenAL initialized.
2014-04-23 20:39:12 [INFO] [STDOUT]
2014-04-23 20:39:12 [INFO] [STDERR] java.lang.NoSuchFieldException: GL_ARB_copy_image
2014-04-23 20:39:12 [INFO] [STDERR] at java.lang.Class.getField(Unknown Source)
2014-04-23 20:39:12 [INFO] [STDERR] at cpw.mods.fml.client.TextureFXManager.getHelper(TextureFXManager.java:122)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.renderer.texture.TextureStitched.init(TextureStitched.java:74)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:154)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:520)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:443)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)
2014-04-23 20:39:12 [INFO] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:732)
2014-04-23 20:39:12 [INFO] [STDERR] at java.lang.Thread.run(Unknown Source)
2014-04-23 20:39:12 [INFO] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled
2014-04-23 20:39:12 [INFO] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-04-23 20:39:12 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-04-23 20:39:13 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-04-23 20:39:13 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-04-23 20:39:13 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
2014-04-23 20:39:14 [INFO] [STDERR] Exception in thread "Thread-12" java.lang.IllegalArgumentException: input stream cannot be null
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96352_a(Request.java:94)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.Request.func_96364_c(Request.java:80)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96377_a(McoClient.java:198)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.mco.McoClient.func_96375_b(McoClient.java:89)
2014-04-23 20:39:14 [INFO] [STDERR] at net.minecraft.client.gui.ThreadTitleScreen.run(ThreadTitleScreen.java:39)
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
2014-04-23 20:39:14 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
2014-04-23 20:39:17 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.2
2014-04-23 20:39:17 [INFO] [Minecraft-Server] Generating keypair
2014-04-23 20:39:18 [INFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@5f425b3b)
2014-04-23 20:39:18 [INFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@5f425b3b)
2014-04-23 20:39:18 [INFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@5f425b3b)
2014-04-23 20:39:18 [INFO] [Minecraft-Server] Preparing start region for level 0
2014-04-23 20:39:19 [INFO] [STDOUT] loading single player
2014-04-23 20:39:19 [INFO] [Minecraft-Server] Player582[/127.0.0.1:0] logged in with entity id 381 at (188.47269718354596, 64.0, 282.1806696411004)
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving and pausing game...
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2014-04-23 20:39:27 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Stopping server
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving players
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving worlds
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2014-04-23 20:39:29 [INFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2014-04-23 20:39:29 [INFO] [ForgeModLoader] Unloading dimension 0
2014-04-23 20:39:29 [INFO] [ForgeModLoader] Unloading dimension -1
2014-04-23 20:39:29 [INFO] [ForgeModLoader] Unloading dimension 1
2014-04-23 20:39:31 [INFO] [Minecraft-Client] Stopping!
2014-04-23 20:39:31 [INFO] [STDOUT]
2014-04-23 20:39:31 [INFO] [STDOUT] SoundSystem shutting down...
2014-04-23 20:39:31 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
2014-04-23 20:39:31 [INFO] [STDOUT]