Jump to content

Recommended Posts

Posted

Doesn't seem to be an error with Neola. I tried using the same coding for both TTSnim and Tomboy, and commenting out everyone but one mob doesn't help. Whether it's Neola, Tomboy, or TTSnim, it still errors. Still, here's all three of them.

 

Neola

 

  Reveal hidden contents

 

Tomboy

 

  Reveal hidden contents

 

TTSnim

 

  Reveal hidden contents

 

Posted
  On 3/30/2014 at 8:52 AM, diesieben07 said:

The args probably changed from 1.6.4 to 1.7 and it was forgotten to change in EnumHelper.

 

The args changed even before there... There was a reason I didn't give him the addCreatureType method, though I probably should have said why. So again, use

private static final Class<?>[][] PARAM_TYPES = new Class[][] {{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}};
public static final EnumCreatureType MY_CREATURE_TYPE = EnumHelper.addEnum(PARAM_TYPES, EnumCreatureType.class, "creatureTypeName", BaseEntityClass.class, 40, Material.air, false, true);

instead of

public static final EnumCreatureType MY_CREATURE_TYPE = EnumHelper.addCreatureType(...)

since Forge doesn't provide the additional boolean parameter (even in 1.6) and thus will crash.

 

The parameters for the addEnum are as following:

par3 - "creatureTypeName" The name of the new enum within the EnumCreatureType class (you CANNOT use this to reference to the new enum directly! That's why the return value of the addEnum method is saved!)

par4 - BaseEntityClass.class The class which should be used as a reference (your mobs shall then use the same class or a childclass of it)

par5 - 40 Determines how much entites should be spawning at maximum

par6 - Material.air The Material the entities should be spawning in, Material.water and Material.air are used in vanilla

par7 - false Determines if it's a peaceful creature (e.g. any animal like cows, chickens etc.)

par8 - true Determines if it's an ambient creature (e.g. bats) an animal (e.g. see above)

 

In your case, it would be:

private static final Class<?>[][] PARAM_TYPES = new Class[][] {{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}};
public static final EnumCreatureType E_NEOLA = EnumHelper.addEnum(PARAM_TYPES, EnumCreatureType.class, "neola", WhateverYourCreatureClassIs.class, 40, Material.air, true, true);

Change those parameters to fit your purpose!

 

To reference it in the addSpawn method use the E_NEOLA variable

EntityRegistry.addSpawn(EntityNeola.class, 100, 8, 10, E_NEOLA, BiomeGenBase.forest);

 

Some notes from me:

  • I encourage that any static final variable is spelled uppercase with underscores separating the words, like MY_FINAL_VAR to distinguish them from normal variables
  • I encourage that any other variable is spelled camelCase, like myNormalVar

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Well, the good news is that I don't have errors with the code anymore ^^ You've all been a big help there, and I thank you. The bad news is...I spent 20 minutes flying through 3 different worlds and still can't find a single one of them naturally spawning (I even created new worlds to see if that did anything). The spawn rates are 100, 8, 10...is that really low or something? I'd think a weighted probability of 100 would be really high and thus cause a lot of spawns...

Posted

Which biomes did you set them to spawn in? You might need to find such a biome and spend some time there looking around. I had a similar issue when horses were added, for I did not know they only spawned in plains and such.

Posted

I have them set for plains, forest, and Jungle. Whereas I've yet to see a jungle biome in any of my worlds, I spent about 20 minutes flying over plains and forest biomes and not seeing any spawns. I saw tons of horses, cows, pigs, sheep, etc. Like...lots more then I've ever seen...but none of my mobs showed. I will admit to having trouble finding spawns before with horses, and with a few other mods I used that had custom mobs in it...so I want to just trust that they are spawning...but I want to be sure...I don't want to release the mod if nothing is spawning, you know? Is there some kind of debug function I could use to test that it's working even if I don't see them spawning?

Posted

I went looking for the spawn code for different creatureTypes and I discovered the possible problem you are encountering getting your creatureType to spawn.

Check this code in BiomeGenBase:

    public List getSpawnableList(EnumCreatureType par1EnumCreatureType)
    {
        return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null)));
    }

Apparently it is not smart enough to support spawning custom CreatureTypes. This makes is hard to accomplish what you want short of using ASM and changing the method. On the other hand, if you used a standard creature type from the list then it should spawn nicely.

Posted

Wow...that sucks...so is it impossible, then, for me to add Tameable creatures without using ASM? (I don't even know what ASM is x.x) Or can I just use like...the standard creature and still make it tameable?

Posted

@sequituri: Certainly didn't expect the code to be so inflexible... I wonder how Mo' Creatures does it?

 

@OP: You can use the vanilla creature types just fine for custom entities provided your entity matches the type (i.e. Mob, Animal / Creature, Ambient, WaterCreature). Note that you will be competing with all mobs that use the same creature types, so for testing you should definitely set your spawn rate to 1000+ just so you can see them spawn.

 

I haven't done much with entity spawning, but Ambient creatures are almost nonexistant in vanilla minecraft, so if you can code your entity to be an ambient creature type and still get the tameable functionality, you won't have much to compete against - but it's more work >.<

Posted

-sighs- nope, that didn't work either...I even tried setting them to spawn in the desert, where nothing else spawns, and still got nothing... I really don't understand what's wrong here v.v

 

EDIT: NO WAIT! I got one of the three to spawn! I think I may have figured out why they weren't spawning!

 

EDIT 2: Okay, still can't get the other version of the code to spawn them (the one SanAndreasP gave me) but I can get them to spawn with the regular code now. So, I'll leave that up to SAP if he wants to try to fix it further. Here's my code for the main:

package craftygirls.main;

import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import net.minecraft.entity.EntityList.EntityEggInfo;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraft.entity.passive.EntityTameable;

@Mod(modid = "craftygirls", name = "The Crafty Girls Core Mod", version = "Alpha v0.1")
public class Main {

@Instance("craftygirls")
public static Main instance;

//Proxies
@SidedProxy(clientSide="craftygirls.main.ClientProxyClass", serverSide="craftygirls.main.CommonProxyClass")
public static CommonProxyClass proxy;

private static final Class[][] paramTypes = new Class<?>[][] {{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}};
public static final EnumCreatureType EnumNeola = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "TypeNeola", EntityNeola.class, 40, Material.air, true, true);
public static final EnumCreatureType EnumTomBoy = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "TypeTomBoy", EntityTomboy.class, 40, Material.air, true, true);
public static final EnumCreatureType EnumTTSnim = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "TypeTTSnim", EntityTTSnim.class, 40, Material.air, true, true);
//Cookies for Tomboy. Flowers for Alice, and Diamonds for Stef

@EventHandler
public void preInit(FMLPreInitializationEvent e){

}

@EventHandler
public void Init(FMLInitializationEvent e) {

	short entityID = 0;
	proxy.registerEntityWithEgg(EntityNeola.class, "Neola", entityID++, this, 128, 1, true, 0x492d00, 0x029820);
	proxy.registerEntityWithEgg(EntityTomboy.class, "TomBoy", entityID++, this, 128, 1, true, 0x290877, 0x03f63b);
	proxy.registerEntityWithEgg(EntityTTSnim.class, "TTSnim", entityID++, this, 128, 1, true, 0x8e69cd, 0xfee02b);
	proxy.registerRenderThings();	

	}

public void postInit(FMLPostInitializationEvent e) {

	EntityRegistry.addSpawn(EntityNeola.class, 1000, 8, 10, EnumNeola, BiomeGenBase.forest);
	EntityRegistry.addSpawn(EntityTomboy.class, 1000, 8, 10, EnumTomBoy, BiomeGenBase.jungle);
	EntityRegistry.addSpawn(EntityTTSnim.class, 1000, 8, 10, EnumTTSnim, BiomeGenBase.plains);

}
}

And, no, I'm not getting any errors with it, I'm just not getting any spawns from it.

Posted
  On 3/31/2014 at 8:58 PM, SureenInk said:

-sighs- nope, that didn't work either...I even tried setting them to spawn in the desert, where nothing else spawns, and still got nothing... I really don't understand what's wrong here v.v

 

EDIT: NO WAIT! I got one of the three to spawn! I think I may have figured out why they weren't spawning!

 

EDIT 2: Okay, still can't get the other version of the code to spawn them (the one SanAndreasP gave me) but I can get them to spawn with the regular code now. So, I'll leave that up to SAP if he wants to try to fix it further. Here's my code for the main:

package craftygirls.main;

import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import net.minecraft.entity.EntityList.EntityEggInfo;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraft.entity.passive.EntityTameable;

@Mod(modid = "craftygirls", name = "The Crafty Girls Core Mod", version = "Alpha v0.1")
public class Main {

@Instance("craftygirls")
public static Main instance;

//Proxies
@SidedProxy(clientSide="craftygirls.main.ClientProxyClass", serverSide="craftygirls.main.CommonProxyClass")
public static CommonProxyClass proxy;

private static final Class[][] paramTypes = new Class<?>[][] {{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}};
public static final EnumCreatureType EnumNeola = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "TypeNeola", EntityNeola.class, 40, Material.air, true, true);
public static final EnumCreatureType EnumTomBoy = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "TypeTomBoy", EntityTomboy.class, 40, Material.air, true, true);
public static final EnumCreatureType EnumTTSnim = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "TypeTTSnim", EntityTTSnim.class, 40, Material.air, true, true);
//Cookies for Tomboy. Flowers for Alice, and Diamonds for Stef

@EventHandler
public void preInit(FMLPreInitializationEvent e){

}

@EventHandler
public void Init(FMLInitializationEvent e) {

	short entityID = 0;
	proxy.registerEntityWithEgg(EntityNeola.class, "Neola", entityID++, this, 128, 1, true, 0x492d00, 0x029820);
	proxy.registerEntityWithEgg(EntityTomboy.class, "TomBoy", entityID++, this, 128, 1, true, 0x290877, 0x03f63b);
	proxy.registerEntityWithEgg(EntityTTSnim.class, "TTSnim", entityID++, this, 128, 1, true, 0x8e69cd, 0xfee02b);
	proxy.registerRenderThings();	

	}

public void postInit(FMLPostInitializationEvent e) {

	EntityRegistry.addSpawn(EntityNeola.class, 1000, 8, 10, EnumNeola, BiomeGenBase.forest);
	EntityRegistry.addSpawn(EntityTomboy.class, 1000, 8, 10, EnumTomBoy, BiomeGenBase.jungle);
	EntityRegistry.addSpawn(EntityTTSnim.class, 1000, 8, 10, EnumTTSnim, BiomeGenBase.plains);

}
}

And, no, I'm not getting any errors with it, I'm just not getting any spawns from it.

 

There's nothing I can do to fix this. It's an issue with the Minecraft code itself:

  Quote

I went looking for the spawn code for different creatureTypes and I discovered the possible problem you are encountering getting your creatureType to spawn.

Check this code in BiomeGenBase:

    public List getSpawnableList(EnumCreatureType par1EnumCreatureType)
    {
        return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null)));
    }

Apparently it is not smart enough to support spawning custom CreatureTypes. This makes is hard to accomplish what you want short of using ASM and changing the method. On the other hand, if you used a standard creature type from the list then it should spawn nicely.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Ahh, all right then, I wasn't sure. Well, then, I guess that's about all I can do with it...I mean, unless somsone wants to tell me how to go about overriding the minecraft code and all, and I don't know if I'm really experienced enough for that yet so. Thanks everyone for the help. ^^

Posted

I just found this, so it may already have been tried and failed...

There is a MinecraftForge event called

WorldEvent.PotentialSpawns

that can be handled and will allow the spawnlist to be set to any spawnlist desired (added to, or removed from). That might make your creature spawn wherever you want. I have not tested this theory, so it's up to you.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Verified users can now unlock a $100 OFF Temu Coupon Code using the verified promo code [ALF401700]. This Temu $100 OFF code works for both new and existing customers and can be used to redeem up to 50% off your next order. Our exclusive Temu coupon code [ALF401700] delivers a flat $100 OFF on top of existing deals. First-time customers using code ALF401700 can save an extra 100% off select items. Returning users also qualify for an automatic $100 OFF discount just by applying this code at checkout. But wait—there’s more. With our Temu coupon codes for 2025, users can score up to 90% OFF on clearance items. Whether you’re shopping in the USA, Canada, UK, or elsewhere, Temu promo code ALF401700 unlocks extra discounts tailored to your account. Some users are saving 100% on items using this 2025 Temu promo code. 🔥 Temu Coupon Highlights Using Code [ALF401700]: Temu new user code – ALF401700: Save 50% off your first order + $100 OFF. Temu promo for existing customers – ALF401700: Enjoy flat $100 OFF instantly. Global availability: Works in the USA, UK, Canada, Germany, France, Japan, Chile, Colombia, Malaysia, Mexico, South Korea, Philippines, Saudi Arabia, Qatar, Pakistan, and more. Top 2025 Coupon Deal: Get $200 OFF plus 100% bonus discounts using code ALF401700. Top-Ranked Temu Deals for 2025 (Coupon Code: ALF401700): ✅ Temu $100 OFF Memorial Day Sale — Use ALF401700 ✅ Temu First Order Coupon — Use ALF401700 for 50% + $100 OFF ✅ Temu USA Coupon Code — Save $100 instantly with ALF401700 ✅ Temu Japan, Germany, Chile Codes — All support ALF401700 ✅ Temu Reddit Discount – $100 OFF: Valid for both new and old users ✅ Temu Coupon Bundle 2025 — $100 OFF + up to 50% slash ✅ 100% OFF Free Gift Code — Use ALF401700, no invite needed ✅ Temu Sign-Up Bonus Promo — Get a welcome $100 OFF instantly ✅ Free Temu Code for New Users — Use ALF401700, no referral required  Temu Clearance Codes 2025 — Use ALF401700 for 85–100% discounts Why ALF401700 is the Best Temu Code in 2025 Using Temu code ALF401700 is your ticket to massive savings, free shipping, first-order discounts, and stackable coupon bundles. Whether you're browsing electronics, fashion, home goods, or beauty products, this verified Temu discount code offers real savings—up to 90% OFF + $100 OFF on qualified orders. 💡 Pro Tip: Apply ALF401700 during checkout in the Temu app or website to activate your instant $100 discount, even if you’re not a new user. Temu $100 OFF Code by Country (All Use ALF401700): 🇺🇸 Temu USA – ALF401700 🇯🇵 Temu Japan – ALF401700 🇲🇽 Temu Mexico – ALF401700 🇨🇱 Temu Chile – ALF401700 🇨🇴 Temu Colombia – ALF401700 🇲🇾 Temu Malaysia – ALF401700 🇵🇭 Temu Philippines – ALF401700 🇰🇷 Temu Korea – ALF401700 🇵🇰 Temu Pakistan – ALF401700 🇫🇮 Temu Finland – ALF401700 🇸🇦 Temu Saudi Arabia – ALF401700 🇶🇦 Temu Qatar – ALF401700 🇫🇷 Temu France – ALF401700 🇩🇪 Temu Germany – ALF401700 🇮🇱 Temu Israel – ALF401700 Temu Coupon Code [ALF401700] Summary for SEO: Temu $100 OFF Code  Temu First Order Discount Code 2025  Temu Verified Promo Code ALF401700  Temu 50% OFF + $100 Bonus  Temu 100% OFF Code 2025  Temu App Promo ALF401700  Temu Working Discount Code 2025 
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • You can check the config of Geckolib and Mowzie's Mobs - maybe there is a way to disable some render features
    • You can use the .requires() function  the server also has a permission level of 4, which is the highest permission level.
  • Topics

×
×
  • Create New...

Important Information

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