Jump to content

[1.8] about spawn a custom entity in the world, probability?Biomas?<Solved>


perromercenary00

Recommended Posts

good nigths

 

this nigth im working on make mi custom entity spawn in the world,

but two things i dont grasp

 

im using this to register and spawn 

 

registrarEntidad( mercenarymod.entidades.hostiles.akCreeper.class , "akCreeper");
EntityRegistry.addSpawn(mercenarymod.entidades.hostiles.akCreeper.class,  8, 1, 5, EnumCreatureType.MONSTER,
BiomeGenBase.plains);

 

//registrar entidad
    public static void registrarEntidad(Class entityClass, String name)
    {
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    long seed = name.hashCode();
    Random rand = new Random(seed);
    int primaryColor = rand.nextInt() * 16777215;
    int secondaryColor = rand.nextInt() * 16777215;

    EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
    System.out.println("$$$ entityID="+entityID+" "+name);
    
    EntityRegistry.registerModEntity(entityClass, name, entityID, instance, 64, 4, true);

    EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
    }

 

#####

in one side i want to now how works spawn rate,  if i leave this in  8, 1, 5, EnumCreatureType.MONSTER,

the mob have very low spawns rate, but spawn

 

if i set it to  99, 1, 5, or 1, 1, 5, or  20, 1, 5,  the entity don't spawn or a least i have not seeit spawing

 

this is a custom creeper it must spawn almost the same as vainilla creeper i need to now creepers spawn rate to set it

 

all, and all the test has been done on a plane whole world all in the plains bioma

 

#####

the other thing  i need to know,

is how i set this spawn to multiples biomas why this line its only spawn in the plains biomas, is there somewhere a  BiomeGenBase.all

or i must write a line per bioma wanted for spawn , if then how do you do whith the custom biomas aded for other mods

 

EntityRegistry.addSpawn(mercenarymod.entidades.hostiles.akCreeper.class,  8, 1, 5, EnumCreatureType.MONSTER,

BiomeGenBase.all); //???? multi biomas

 

 

thanks for reading

Link to comment
Share on other sites

 

hey thanks the bioma[]  fix it,

 

and then the  100, 4, 4 (weight, min, max). means the entity shall spanw 100% for sure

whit at least four entityes per chunk

 

and now i remenber and old doub the entity ID

 

 

//preinit

registroSimple( mercenarymod.entidades.hostiles.akCreeper.class , "akCreeper");

 

   
    //#### 
    //registrar entidad Simple
    public static void registroSimple(Class entityClass, String name)
    {
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    EntityRegistry.registerModEntity(entityClass, name, entityID, instance, 64, 4, true);
    }
    

 

//Init

    BiomeGenBase[] allBiomes =  FluentIterable.from(Arrays.asList(BiomeGenBase.getBiomeGenArray())).filter(Predicates.notNull()).toArray(BiomeGenBase.class);

   

EntityRegistry.addSpawn(mercenarymod.entidades.hostiles.akCreeper.class,  100, 1, 5, EnumCreatureType.MONSTER, allBiomes);

 

 

i read some where than the EntityRegistry.findGlobalUniqueEntityId(); has a limit of 256  and becoze of this is bether to set ids manually

and spawning eggs dont work unless you use and id from  EntityRegistry.findGlobalUniqueEntityId();

 

spawn eggs are not of concern for mi mod and i dont see a reason  i coul'dn make a common item egg shaped to spawn mi entityes

 

if ist true the limit of 256  what is the rules to asign id numbers coz  i remenber the times of 1.6 whith their  mobs id conflict focking up at the startup of minecraft,  and wanna avoid that if posible

 

thanks for reading

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.