Jump to content

Recommended Posts

Posted

hello everyone, so i have a problem, i started making a config but it doesn't work, basicly i wan't to make it so you would be able to select activate specific mob or not? (register mob) but it doesn't work, can you tell me whats wrong?

 

 

main file

 
@EventHandler
public void preInit(FMLPreInitializationEvent e) {


    Config.loadConfig(e);


	}

 

 

 

Config

public class Config
{
    

    public static boolean EnableHallowenCow = true;
  

    public static void loadConfig(FMLPreInitializationEvent event)
{
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());

	config.load();


	EnableHallowenCow = config.get(Configuration.CATEGORY_GENERAL, "EnableHallowenCow", true).getBoolean(true);

	config.save();
}
    }

 

 

settings in entity class

 

if (Config.EnableHallowenCow == true){
	EntityRegistry.registerGlobalEntityID(EntityHallowenCow.class, "HallowenCow", EntityRegistry.findGlobalUniqueEntityId(), 0x7AE8FF, 0x47FFE5);

	}

 

 

basicly config appears but won't mob dissapear, i set mob active to false, mob will still be in the game, will not dissapear.

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Posted

Your configuration code looks correct to me.

 

What do you mean you want the entity to disappear? Do you mean you create a world with the entity in it and then change the config and load the same world? Or do you mean you create a new world but still get the spawn egg for the entity even though the config is false?

 

I'm not sure that not registering would delete an entity that is already existing. In other words if the entity is created in the world and then you change the config and reload the world I think it would still be there.

 

If you want it to go away, I think you might want to use an event to get rid of the entity when it is trying to be constructed or join the world.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

when config is = true entity is there, but at the same time when i set config = false, entity still will be in the game.

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Posted

i want entity to get removed with the spawn egg, so it wouldn't even exist at that point when will be set to false, so you would able to disable or enable specific entity in config

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

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.