It is not an entity problem because you can hear the entity(which the sounds are in the entity class) so the only issue is the rendering because it is spawning fine if you can hear it. I don't use custom mobs(change entities for other mobs already in game to be use as your own) so I cant say... I know for a fact that you need what I told you to put in so that was not the only issue... from everything else I see it look like you have the tracker in the render method, and you do not want that in there(put that in load)(I doubt that is the issue but it could be for all I know). Try asking this (with your code) in a tutorial that is up to date that has mob tutorials as they might know as I don't know custom rendering as I haven't done that in my mod yet... Sorry if I wan't any help there...
Yea i don't know how to do rendering.. i got that source code from a youtube tutorial :/ i really wanna be able to do this.. but its not working :/
BaseMod - your mod Class - Entity class int - Entity Id int - View distance of entity int - update frequency, in ticks boolean - Whether or not its motion should be tracked by the integrated server.
After it's added it to ModLoader, override the following two methods in your BaseMod class spawnEntity and getSpawnPacket
Here is an example
@Override
public Entity spawnEntity(int entityId, World worldClient, double x,
double y, double z) {
switch (entityId) {
case 101:
return new EntityBlank(worldClient, x, y, z);
default:
return null;
}
}
@Override
public Packet23VehicleSpawn getSpawnPacket(Entity entity, int type) {
if (entity instanceof EntityBlank)
return new Packet23VehicleSpawn(entity, type);
else
return null;
}
In the first method I made a switch statement which will create the Entity based on the Id of Entity. The second method I do an if statement depending on what Entity it is and make the Vehicle Packet.
If your Vehicle Packet will always be the same you could remove the if-else statement.
@Override
public Packet23VehicleSpawn getSpawnPacket(Entity entity, int type) {
return new Packet23VehicleSpawn(entity, type);
}
ModLoader.getUniqueEntityId()
Still don't use that method, until it is fixed.
New issue, i used this method.. my mob appeared!! only for a second then it disappeared.. whyyyyyy! help?!
New issue, i used this method.. my mob appeared!! only for a second then it disappeared.. whyyyyyy! help?!
i kept getting this Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Hi I'm newbie of modding and starting creating mod of explosive...
And i want to make Entity, Now i want to make and explosion that can hit the ground into bedrock...
can you help me on what code should i use? Im using MC 1.3.2
java.lang.NoSuchMethodException: net.minecraft.src.EntityPirate.<init>(net.minecraft.src.World)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at net.minecraft.src.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:148)
at net.minecraft.src.WorldServer.tick(WorldServer.java:106)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:613)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:555)
at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:122)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:464)
at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)
I used to have 27 as ModLoader.getUniqueEntityId() which crashed the game. The pirate class is based on the ZombiePigMan class.
Rollback Post to RevisionRollBack
If your thread has been resolved and you're satisfied with your results then go to: Tools > Edit Thread and add [SOLVED] to the title. Also if your results are satisfying or someone greatly helped you, don't forget to give them a like on their post.
java.lang.NoSuchMethodException: net.minecraft.src.EntityPirate.<init>(net.minecraft.src.World)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
Look at EntityList.createEntityByID(int, World)
It creates the Entity using reflection.
So it looks for the constructor which has the World object as the parameter. If it is found it will make a new instance of the Entity, otherwise it will throw a NoSuchMethodException. That being said you need to add a constructor which only has the World object as it's parameter.
public EntityBlank(World world) {
super(world);
// code
}
Look at EntityPigZombie.class and you can see it has that constructor as I mentioned above. Do the same in your EntityPirate class.
Rollback Post to RevisionRollBack
Same ****, different day - Modification Development Section
Seems like the Entity problem is fixed.... but I has a question! I am having a similar, yet not the same problem.... My Entities (Non-living) can't be seen, but can be heard and have the same effect as if they were there. So I know it must be a problem somewhere with how it is rendered or something.... I can't seem to see my arrows/Throwing items x.x Did the renderstyle change for both of them?
Rollback Post to RevisionRollBack
It's a Link/Banner, click it~ WIP hence the Stage 1
Seems like the Entity problem is fixed.... but I has a question! I am having a similar, yet not the same problem.... My Entities (Non-living) can't be seen, but can be heard and have the same effect as if they were there. So I know it must be a problem somewhere with how it is rendered or something.... I can't seem to see my arrows/Throwing items x.x Did the renderstyle change for both of them?
Same here, never used Forge. I don't like to use API's unless it's absolutely needed. So far the modloader way has been working but there still seems to be some problems as I have read on here.
Yea i don't know how to do rendering.. i got that source code from a youtube tutorial :/ i really wanna be able to do this.. but its not working :/
New issue, i used this method.. my mob appeared!! only for a second then it disappeared.. whyyyyyy! help?!
i kept getting this Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
Skipping Entity with id EntityCobbleStoneMOB
that worked for me
to
It wont appear.
And yes i know to change it from creature to monster you must change the EntityNAME file
to extend EntityMob and not EntityCreature
Any help on making my mobs Monsters without them dissapearing?
And i want to make Entity, Now i want to make and explosion that can hit the ground into bedrock...
can you help me on what code should i use? Im using MC 1.3.2
Here's my Entity file Sample
EntitySample
public class EntitySampleBomb extends Entity
{
public EntitySampleBomb (World world)
{
super(world);
fuse = 0;
preventEntitySpawning = true;
setSize(0.98F, 0.98F);
yOffset = height / 2.0F;
}
public EntitySampleBomb (World world, double d, double d1, double d2)
{
this(world);
setPosition (d, d1, d2);
float f = (float)(Math.random()* 3.141592741012732D * 2D);
motionX = -MathHelper.sin((f * 3.141593F) / 180F) * 0.02F;
motionY = 0.20000000298023224D;
motionZ = -MathHelper.cos(( f * 3.141593F) / 180F) * 0.02F;
fuse = 100;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}
protected void entityUnit()
{
}
protected boolean canTriggerWalking()
{
return false;
}
public boolean canBeCollidedWith()
{
return !isDead;
}
public void onUpdate()
{
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
motionY -= 0.039999999105930328D;
moveEntity(motionX, motionY, motionZ);
motionX *= 0.98000001907348633D;
motionY *= 0.98000001907348633D;
motionZ *= 0.98000001907348633D;
if(onGround)
{
motionX *= 0.69999998807907104D;
motionZ *= 0.69999998807907104D;
motionY += -0.5D;
}
if(fuse -- <= 0)
{
setDead();
explode();
}
//CODE WRITTEN BY THEINSTITUTIONS
else
{
worldObj.spawnParticle("smoke", posX, posY + 0.5D, posZ, 0.0D, 0.0F, 0.0D);
}
}
private void explode()
{
float f = 4F; //Change this value to the size of your explosion
worldObj.createExplosion(null, posX, posY, posZ, f);
}
protected void writeEntityToNBT(NBTTagCompound tut)
{
tut.setByte("Fuse", (byte)fuse);
}
protected void readEntityFromNBT(NBTTagCompound tut)
{
fuse = tut.getByte("Fuse");
}
public float getShadowSize()
{
return 0.0F;
}
public int fuse;
protected void entityInit()
{
}
}
rememeber that monsters only apear at night... and why do you want to change it from creature? you can have hostle creatures too.
you can? omg.. having hostile creatures would help so much.. can you link me to a tutorial on how to do this?
I'm trying to make a custom mob that looks like tnt and will blow up upon attacking it... so i copied almost everything froma creeper.
I have had problems rendering my throwable items, and now they work perfectly.
Thanks again, to all you guys that helped
ModLoader.registerEntityID(EntityPirate.class, "Pirate", 27);
ModLoader.addSpawn(EntityPirate.class, 120, 4, 4, EnumCreatureType.monster, new BiomeGenBase[]{
BiomeGenBase.ocean,
BiomeGenBase.river,
BiomeGenBase.plains
]);
That code gives me this error:
java.lang.NoSuchMethodException: net.minecraft.src.EntityPirate.<init>(net.minecraft.src.World)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at net.minecraft.src.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:148)
at net.minecraft.src.WorldServer.tick(WorldServer.java:106)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:613)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:555)
at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:122)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:464)
at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)
I used to have 27 as ModLoader.getUniqueEntityId() which crashed the game. The pirate class is based on the ZombiePigMan class.
@AdvJavaCoder
Look at EntityList.createEntityByID(int, World)
It creates the Entity using reflection.
So it looks for the constructor which has the World object as the parameter. If it is found it will make a new instance of the Entity, otherwise it will throw a NoSuchMethodException. That being said you need to add a constructor which only has the World object as it's parameter.
Look at EntityPigZombie.class and you can see it has that constructor as I mentioned above. Do the same in your EntityPirate class.
It's a Link/Banner, click it~ WIP hence the Stage 1
http://www.minecraftforum.net/topic/1417041-mod-entity-problem/page__st__20#entry17445833
That's for arrows and other Entities, not for Mobs. Still looking into the issue when I have time.
How are you spawning the block?
Edit:
Wait.... Looking into one file I have may help me... if not I will edit this.
Edit:
Never mind... I found an Entity render file in Forge, but it doesn't seem to work very well... could just be me.
It's a Link/Banner, click it~ WIP hence the Stage 1
It's a Link/Banner, click it~ WIP hence the Stage 1