Jump to content

Spawing client side isnt working[1.7.10]


Recommended Posts

my code isn't working to spawn the entitys client side.

	 public void setDead(){ 

	 if (!this.worldObj.isRemote){


			for (int i = 0 ; i < 2 ; i++){
			EntityCell cell = this.createInstance();
			cell.setPosition(this.posX, this.posY, this.posZ);
			this.worldObj.spawnEntityInWorld(cell);
            
        
}
	 super.setDead();
}

 }




public EntityCell createInstance() {

	return new EntityCell(this.worldObj);
}

any Ideas?

Im serious don't look at it!!

Link to comment
Share on other sites

yes

package com.OlympiansMod.entity;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;

import com.OlympiansMod.Main.MainRegistry;

import cpw.mods.fml.common.registry.EntityRegistry;

public class MEntity {
public static void MainRegistry(){ 
	registerEntity();
}
public static void registerEntity(){
	createEntity(EntityGreekFire.class, "GreekFire");
	createEntity(EntityBullet.class, "Bullet");
	createEntity(EntitySGuardian.class, "SGuardian");
	createEntity(EntitySGolem.class, "SGolem");
	createEntity(EntityUndead.class, "Undead");
	createEntity(EntityUndeadGreekArcher.class, "UndeadArcherGreek");
	createEntity(EntityThunderBolt.class, "ThunderBolt");
	createEntity(EntityMasterBolt.class, "MasterBolt");
	createEntity(Zeus.class, "Zeus");
	createEntity(Arachne.class, "Arachne");
	createEntity(EntityCell.class, "EntityCell");



}
public static void createEntity(Class entityClass, String entityName){
	EntityRegistry.registerModEntity(EntityGreekFire.class, "GreekFire", 4013479, MainRegistry.modInstance, 1, 80, true);
	EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", 302942, MainRegistry.modInstance, 1, 80, true);
	EntityRegistry.registerModEntity(EntitySGuardian.class, "SGaurdian", 301320, MainRegistry.modInstance, 80, 1, true);
	EntityRegistry.registerModEntity(EntitySGolem.class, "EntitySGolem", 420193, MainRegistry.modInstance, 80, 1, true);
	EntityRegistry.registerModEntity(EntityUndead.class, "UndeadRoman", 403998, MainRegistry.modInstance, 80, 1, true);
	EntityRegistry.registerModEntity(EntityUndeadGreekArcher.class, "UndeadArcherGreek", 403698, MainRegistry.modInstance, 80, 1, true);
	EntityRegistry.registerModEntity(EntityThunderBolt.class, "ThunderBolt", 413698, MainRegistry.modInstance, 80, 1, true);
	EntityRegistry.registerModEntity(EntityMasterBolt.class, "MasterBolt", 413798, MainRegistry.modInstance, 80, 1, true);
	EntityRegistry.registerModEntity(Zeus.class, "Zeus", 414798, MainRegistry.modInstance, 100, 1, true);
	EntityRegistry.registerModEntity(Arachne.class, "Arachne", 414799, MainRegistry.modInstance, 80, 1, true);
	EntityRegistry.registerModEntity(EntityCell.class, "EntityCell", 414789, MainRegistry.modInstance, 80, 1, true);








}



}




Im serious don't look at it!!

Link to comment
Share on other sites

Your entity registry code is f*cked up... Issues with it are:

- You register every Entity atleast 10 times.

- What is up with those Entity IDs?

- You messed up the

trackingRange

and

updateFrequency

parameters in some of the calls to

registerModEntity()

.

- Making a method for registering entities is redundant. Why make a method with 1 line of code, instead of a single line of code? No methods needed.

- And if you still decide to make a method (just don't), actually use the parameters...

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

so you wan m to register my entitys like this?

package com.OlympiansMod.entity;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;

import com.OlympiansMod.Main.MainRegistry;
import com.sun.xml.internal.bind.v2.model.core.ID;

import cpw.mods.fml.common.registry.EntityRegistry;

public class MEntity {
public static void MainRegistry(){ 
	registerEntity();
}
public static void registerEntity(){
	createEntity(EntityGreekFire.class, "GreekFire");
	createEntity(EntityBullet.class, "Bullet");
	createEntity(EntitySGuardian.class, "SGuardian");
	createEntity(EntitySGolem.class, "SGolem");
	createEntity(EntityUndead.class, "Undead");
	createEntity(EntityUndeadGreekArcher.class, "UndeadArcherGreek");
	createEntity(EntityThunderBolt.class, "ThunderBolt");
	createEntity(EntityMasterBolt.class, "MasterBolt");
	createEntity(Zeus.class, "Zeus");
	createEntity(Arachne.class, "Arachne");
	createEntity(EntityCell.class, "EntityCell");



}
public static void createEntity(Class entityClass, String entityName){

	int randomID = EntityRegistry.findGlobalUniqueEntityId();
	EntityRegistry.registerModEntity(entityClass, entityName, randomID, MainRegistry.modInstance, 1, 80, true);
	//EntityRegistry.registerModEntity(EntityGreekFire.class, "GreekFire", 4013479, MainRegistry.modInstance, 1, 80, true);
	//EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", 302942, MainRegistry.modInstance, 1, 80, true);
	//EntityRegistry.registerModEntity(EntitySGuardian.class, "SGaurdian", 301320, MainRegistry.modInstance, 80, 1, true);
	//EntityRegistry.registerModEntity(EntitySGolem.class, "EntitySGolem", 420193, MainRegistry.modInstance, 80, 1, true);
	//EntityRegistry.registerModEntity(EntityUndead.class, "UndeadRoman", 403998, MainRegistry.modInstance, 80, 1, true);
	//EntityRegistry.registerModEntity(EntityUndeadGreekArcher.class, "UndeadArcherGreek", 403698, MainRegistry.modInstance, 80, 1, true);
	//EntityRegistry.registerModEntity(EntityThunderBolt.class, "ThunderBolt", 413698, MainRegistry.modInstance, 80, 1, true);
	//EntityRegistry.registerModEntity(EntityMasterBolt.class, "MasterBolt", 413798, MainRegistry.modInstance, 80, 1, true);
	//EntityRegistry.registerModEntity(Zeus.class, "Zeus", 414798, MainRegistry.modInstance, 100, 1, true);
	//EntityRegistry.registerModEntity(Arachne.class, "Arachne", 414799, MainRegistry.modInstance, 80, 1, true);
	//EntityRegistry.registerModEntity(EntityCell.class, "EntityCell", 414789, MainRegistry.modInstance, 80, 1, true);








}



}




Im serious don't look at it!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.