1
Modloader Error w/ AddSpawn(string, int, EnumCreatureType)
Hey Im trying to make my first mod and I get this error:
I am using this as my mod_Mob file:
Please Help?
java.lang.Error: Unresolved compilation problem:
The method AddSpawn(Class<EntityJetPackCreeper>, int, EnumCreatureType) is undefined for the type ModLoader
at net.minecraft.src.mod_Mob.AddMobs(mod_Mob.java:17)
at net.minecraft.src.mod_Mob.<init>(mod_Mob.java:11)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:269)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1275)
at net.minecraft.src.ModLoader.init(ModLoader.java:831)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:154)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:423)
at net.minecraft.client.Minecraft.run(Minecraft.java:784)
at java.lang.Thread.run(Unknown Source)
I am using this as my mod_Mob file:
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
public class mod_Mob extends BaseMod
{
public mod_Mob()
{
AddMobs();
}
public void AddMobs()
{
ModLoader.registerEntityID(EntityJetPackCreeper.class, "jpcreep", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(EntityJetPackCreeper.class, 500, EnumCreatureType.creature);
}
public void AddRenderer(Map map)
{
map.put(EntityJetPackCreeper.class, new RenderJetPackCreeper(new ModelJetPackCreeper(), 0.5F));
}
public String Version()
{
return "3.14159265";
}
}
Please Help?
Create an account or sign in to comment.
2
1
Im not very experienced at modding, but I took a look at ModLoader's javadoc and found this out:
The way the constructor works is like this
entityName - The entity to be spawned. In your case "JetPackCreeper"
ProbabilityOfSpawning - This higher this is, the more likely it will spawn.
MinimumNumberSpawned - The minimum number of entities to be spawned in one attempt
MaximumNumberSpawned - The maximum number of entities to be spawned in one attempt
type - The type of mob it is. In your case you would put "Monster"
Biome - The biome it will spawn in. I'm not sure how you would indicate multiple biomes, so you would have to play around with it yourself.
That's the general layout. Some of the pieces may need to be formatted in some specific way such as the entityName. Hope I could help, good luck!
The way the constructor works is like this
ModLoader.AddSpawn(entityName, ProbabilityOfSpawning, MinimumNumberSpawned, MaximumNumberSpawned, type, Biome)
entityName - The entity to be spawned. In your case "JetPackCreeper"
ProbabilityOfSpawning - This higher this is, the more likely it will spawn.
MinimumNumberSpawned - The minimum number of entities to be spawned in one attempt
MaximumNumberSpawned - The maximum number of entities to be spawned in one attempt
type - The type of mob it is. In your case you would put "Monster"
Biome - The biome it will spawn in. I'm not sure how you would indicate multiple biomes, so you would have to play around with it yourself.
That's the general layout. Some of the pieces may need to be formatted in some specific way such as the entityName. Hope I could help, good luck!
1
Bump. Are there any modders willing to help?