Jump to content

Recommended Posts

Posted

hello i was trying to create a config file in forge 1.7.2

but the config himself works but it ignores the ids

 

Entity Register in Main Class:

 

EntityRegistry.registerModEntity(EntityPeanut.class, "EntityPeanut", thisPeanutId, this, 80, 3, true);

EntityRegistry.addSpawn(EntityPeanut.class, 100, 3, 6, EnumCreatureType.creature, new BiomeGenBase[] { BiomeGenBase.mushroomIsland});

EntityList.addMapping(EntityPeanut.class, "EntityPeanut", this.PeanutId, 4534038, 14071595);

 

 

Config Register in Main Class:

 

ConfigHandler.init(event.getSuggestedConfigurationFile());

 

 

int in Main Class:

 

public static int PeanutId;

 

 

Configuration class:

 

package com.Peanut.common;

 

import java.io.File;

 

import net.minecraftforge.common.config.Configuration;

 

public class ConfigHandler

{

public static void init(File configFile)

{

Configuration config = new Configuration(configFile);

 

config.load();

 

Peanut.PeanutId = config.get("Mobs", "Peanut Id", 30).getInt();

 

config.save();

}

}

 

 

 

Generated Config File:

 

# Configuration file

 

####################

# mobs

####################

 

mobs {

    I:"Peanut Id"=30

}

 

 

 

 

 

 

but when im ingame the entity has id: 0

what am i doing wrong

 

 

 

 

 

 

 

 

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.