Jump to content

OrangeVillager61

Members
  • Posts

    339
  • Joined

  • Last visited

Everything posted by OrangeVillager61

  1. Ah, I misunderstood. Players can use a config file to change the amount of iron golems can spawn.
  2. In MC there is a class known as village.class which contains much of the village calculations. I'm trying to figure out how to replace the MC one with my own version of the file. The ideal end result is that the part of villages that are handled by MC village.class should be handled by mine.
  3. Hello fellow modders! It has been a while and I'm making a mod that improves villagers and villages. I'm currently at village.class and I'm wondering how to override the MC one with my own.
  4. Config file below: # Configuration file general { # Set this to the number that you want from bucket of salt when crafting(1-16), for game balance I'd leave it to the default. [range: 1 ~ 16, default: 4] I:"Amount of salt per brine"=4 # Set this to false if you want to disallow the crafting of biomatter and all spawn eggs. [default: true] B:"Enable Biomatter"=true # Set this to true if you want salt. [default: true] B:"Enable Salt"=true # Set this to false if you want to disallow the crafting of creeper spawn eggs and blaze spawn eggs. Mainly for griefing prevention. Note: Disabling biomatter also disables ''griefer'' eggs. [default: true] B:"Enable crafting of ''griefer'' eggs"=true # If this is true, then WIP custom villagers will spawn. Please back up your world(s) when disabling this. [default: true] B:"Enable custom villagers"=true # Set this to true if you want raw ender to have status effects. [default: true] B:"Endermeat Enable"=true }
  5. Yes, the config file also says true.
  6. Why does my config file always return false? The default is true but it returns false. public class Config { public static boolean ender_meat_enable; public static int amount_salt_brine; public static boolean enable_custom_villagers; public static boolean creeper_crafting_enable; public static boolean enable_biomatter; public static boolean enable_salt; public static boolean enable_drops; public static final Config instance = new Config(); public void load(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); amount_salt_brine = config.getInt("Amount of salt per brine", Configuration.CATEGORY_GENERAL, 4, 1, 16, "Set this to the number that you want from bucket of salt when crafting(1-16), for game balance I'd leave it to the default."); ender_meat_enable = config.getBoolean("Endermeat Enable", Configuration.CATEGORY_GENERAL, true, "Set this to true if you want raw ender to have status effects."); creeper_crafting_enable = config.getBoolean("Enable crafting of ''griefer'' eggs", Configuration.CATEGORY_GENERAL, true, "Set this to false if you want to disallow the crafting of creeper spawn eggs and blaze spawn eggs. Mainly for griefing prevention. Note: Disabling biomatter also disables ''griefer'' eggs."); enable_salt = config.getBoolean("Enable Salt", Configuration.CATEGORY_GENERAL, true, "Set this to true if you want salt."); enable_biomatter = config.getBoolean("Enable Biomatter", Configuration.CATEGORY_GENERAL, true, "Set this to false if you want to disallow the crafting of biomatter and all spawn eggs."); enable_custom_villagers = config.getBoolean("Enable custom villagers", Configuration.CATEGORY_GENERAL, true, "If this is true, then WIP custom villagers will spawn. Please back up your world(s) when disabling this."); if (config.hasChanged()) { config.save(); } } }
  7. I added it now to the crash report snippet.
  8. ItemStack ZombieEgg = new ItemStack (Items.SPAWN_EGG); applyEntityIdToItemStack(ZombieEgg, "Zombie"); GameRegistry.addRecipe(ZombieEgg, new Object[] {" HE", "ATA", "L L", ('A'), MoDropsItems.zombie_arm,('E'), MoDropsItems.adaptive_egg, Character.valueOf('T'), MoDropsItems.zombie_torso, Character.valueOf('L'), MoDropsItems.zombie_leg, Character.valueOf('H'), Items.SKULL, 1, 2}); Crash: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Character at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:244) at net.minecraftforge.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:230) at net.minecraftforge.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:225) at orangeVillager61.MoDrops.MoRecipes.addRecipes(MoRecipes.java:116)
  9. What is the value for a zombie head for crafting? Items.SKULL, 1, 2 crashes minecraft.
  10. Alright I got it to work . But one last question: is the AI handled completely server side?
  11. I was using EntityJoinWorld event and then I saw LivingSpawnEvent so I got confused.
  12. Okay I used the wrong event apparently, what do I use for EventYouAreUsingClass? LivingSpawnEvent?
  13. Yeah, but that could easily break or make useless other mods that affect the villager.
  14. Alright, I've got the event class, but I cannot find the tasks.add command.
  15. How to override vanilla AI with a modified version of the same AI. I'm making a small mod where it reduces the doors required for villager breeding and I made a class with a slightly edited version of the villager mate AI. However how do I override the vanilla AI?
  16. When my custom villager dies it turns into a regular zombie instead of turning into a zombie villager. My custom villager class. package orangeVillager61.MoDrops.villager; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityVillager.EmeraldForItems; import net.minecraft.entity.passive.EntityVillager.ListItemForEmeralds; import net.minecraft.entity.passive.EntityVillager.PriceInfo; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.EntityEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.registry.VillagerRegistry; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; import orangeVillager61.MoDrops.Config; import orangeVillager61.MoDrops.items.MoDropsItems; public class BioMaker{ public static final boolean enableSaltTrader = Config.enableCustomVillagers; public static ItemStack Charcoal = new ItemStack (Items.COAL, 1, 1); protected static final VillagerRegistry.VillagerProfession PROFESSION = new VillagerRegistry.VillagerProfession("md:BioMaker", "minecraft:textures/entity/villager/villager.png", "md:textures/entity/zombie_bioMaker.png"); protected static final VillagerRegistry.VillagerCareer CAREER = new VillagerRegistry.VillagerCareer(PROFESSION, "md:BioMaker").addTrade(3, new ListItemForEmeralds(MoDropsItems.adaptive_egg, new PriceInfo(26, 33))).addTrade(1, new EmeraldForItems(Items.GOLD_INGOT, new PriceInfo(8, 9))).addTrade(1, new ListItemForEmeralds(MoDropsItems.biomatter, new PriceInfo(1, 1))).addTrade(2, new ListItemForEmeralds(MoDropsItems.compressed_biomatter, new PriceInfo(8, 10))) .addTrade(2, new ListItemForEmeralds(Charcoal, new PriceInfo(1, 3))); public static void onInit(FMLInitializationEvent event){ VillagerRegistry.instance().register(PROFESSION); } }
  17. When forge checks for the latest version of my mod it doesn't work. I tested it by changing the version of my mod on eclipse to a different one. I looked at the log and got this: [21:33:45] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json [21:33:45] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: BETA Target: null json My update.json (on github and I didn't use gist) "homepage": "http://minecraft.curseforge.com/projects/modrops/files", "promos": { "1.8.9-latest": "0.3.0_2", "1.8.9-recommended": "0.3.0_2", "1.10-latest": "0.5.3", "1.10-recommended": "0.5.3" "1.10.2-latest": "0.5.2" "1.10.2-recommended": "0.5.2" }, "{MinecraftVersion}: { "1.10: { "0.5.1": "Added netherrack drop for nether quartz ore. Fixed the adaptive egg recipe. Started work on the custom villager: Biomaker. Mostly done but has only four trades." } } Link to it: https://github.com/Orange1861/update.json/blob/master/update.json My @mod package orangeVillager61.MoDrops; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.oredict.OreDictionary; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, updateJSON = "{https://github.com/Orange1861/update.json/blob/master/update.json}") public class MoDrops { @Instance public static MoDrops instance = new MoDrops(); @SidedProxy(clientSide="orangeVillager61.MoDrops.ClientProxy", serverSide="orangeVillager61.MoDrops.ServerProxy") public static CommonProxy proxy; public static final MoDropsTab tabMoDrops = new MoDropsTab("tabMoDrops"); @EventHandler public void preInit(FMLPreInitializationEvent e) { proxy.preInit(e); Config.instance.load(e); } @EventHandler public void init(FMLInitializationEvent e) { proxy.init(e); } @EventHandler public void postInit(FMLPostInitializationEvent e) { proxy.postInit(e); } };
  18. Okay, I did what you said but I get a crash. @SideOnly(Side.CLIENT) public static void applyEntityIdToItemStack(ItemStack stack, String entityId) { NBTTagCompound nbttagcompound = new net.minecraft.nbt.NBTTagCompound(); NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setString("id", entityId); nbttagcompound.setTag("EntityTag", nbttagcompound1); stack.setTagCompound(nbttagcompound); //crashing line } public static void addRecipes() { ItemStack VillagerEgg = null; applyEntityIdToItemStack(VillagerEgg, "120"); System.out.println(VillagerEgg); GameRegistry.addRecipe((VillagerEgg), new Object[] {"BBB", "VAE", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('V'), MoDropsBlocks.villager_nose, Character.valueOf('E'), Items.EMERALD}); }
  19. Alright I changed it to a side only function however it crashes the game. @SideOnly(Side.CLIENT) protected static ItemStack eggMaker(ItemStack var, String mobName, int numEggs){ net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound(); nbt.setString("entity_name", mobName); ItemStack Egg = new ItemStack(Items.SPAWN_EGG, numEggs); Egg.setTagCompound(nbt); var = Egg; return var; } public static void addRecipes() { ItemStack VillagerEgg = null; eggMaker(VillagerEgg, "Villager", 2); GameRegistry.addRecipe((VillagerEgg), new Object[] {"BBB", "VAE", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('V'), MoDropsBlocks.villager_nose, Character.valueOf('E'), Items.EMERALD}); }
  20. Okay, how did the format change?
  21. Um, I don't understand, don't I already do that?
  22. I have an issue where when you craft spawn eggs using a recipe from my mod the spawn egg is labeled "spawn" and doesn't spawn the mob. This code worked in 1.8.9. Note: I have removed some of class because it is irrelevant for this. package orangeVillager61.MoDrops; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import orangeVillager61.MoDrops.blocks.MoDropsBlocks; import orangeVillager61.MoDrops.items.MoDropsItems; public class MoRecipes { public MoRecipes() { super(); } public static int amountSaltBrine = Config.amountSaltBrine; public static void addRecipes() { //removed stuff net.minecraft.nbt.NBTTagCompound nbtV = new net.minecraft.nbt.NBTTagCompound(); nbtV.setString("entity_name", "Villager"); ItemStack VillagerEgg = new ItemStack(Items.SPAWN_EGG, 2); VillagerEgg.setTagCompound(nbtV); GameRegistry.addRecipe((VillagerEgg), new Object[] {"BBB", "VAE", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('V'), MoDropsBlocks.villager_nose, Character.valueOf('E'), Items.EMERALD}); net.minecraft.nbt.NBTTagCompound nbtC = new net.minecraft.nbt.NBTTagCompound(); nbtC.setString("entity_name", "Creeper"); ItemStack CreeperEgg = new ItemStack(Items.SPAWN_EGG); CreeperEgg.setTagCompound(nbtC); if (Config.CreeperCraftingEnable == true){ GameRegistry.addRecipe((CreeperEgg), new Object[] {"BBB", "GAG", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('G'), Items.GUNPOWDER}); } net.minecraft.nbt.NBTTagCompound nbtB = new net.minecraft.nbt.NBTTagCompound(); nbtB.setString("entity_name", "Blaze"); ItemStack BlazeEgg = new ItemStack(Items.SPAWN_EGG); BlazeEgg.setTagCompound(nbtB); if (Config.CreeperCraftingEnable == true){ GameRegistry.addRecipe((BlazeEgg), new Object[] {"BBB", "GAG", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('G'), Items.BLAZE_ROD}); } net.minecraft.nbt.NBTTagCompound nbtS = new net.minecraft.nbt.NBTTagCompound(); nbtS.setString("entity_name", "Squid"); ItemStack SquidEgg = new ItemStack(Items.SPAWN_EGG); SquidEgg.setTagCompound (nbtS); //the stuff below was commented out due to a strange crash //GameRegistry.addRecipe((SquidEgg), new Object[] // {"BBB", // "GAG", // "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('G'), Items.DYE, 1, 0}); net.minecraft.nbt.NBTTagCompound nbtCh = new net.minecraft.nbt.NBTTagCompound(); nbtCh.setString("entity_name", "Chicken"); ItemStack ChickenEgg = new ItemStack(Items.SPAWN_EGG); ChickenEgg.setTagCompound(nbtCh); GameRegistry.addRecipe((ChickenEgg), new Object[] {"BBB", "GAG", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('G'), Items.FEATHER}); net.minecraft.nbt.NBTTagCompound nbtP = new net.minecraft.nbt.NBTTagCompound(); nbtP.setString("entity_name", "Pig"); ItemStack PigEgg = new ItemStack(Items.SPAWN_EGG); PigEgg.setTagCompound(nbtP); GameRegistry.addRecipe((PigEgg), new Object[] {"BBB", "GAG", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_egg, Character.valueOf('G'), Items.PORKCHOP}); //removed stuff here too. public static void main(String[] args) {} }
  23. package orangeVillager61.MoDrops.villager; import net.minecraft.entity.passive.EntityVillager.EmeraldForItems; import net.minecraft.entity.passive.EntityVillager.ITradeList; import net.minecraft.entity.passive.EntityVillager.ListItemForEmeralds; import net.minecraft.entity.passive.EntityVillager.PriceInfo; import net.minecraft.init.Items; import orangeVillager61.MoDrops.items.MoDropsItems; public class SaltTrader_trades { public static final ITradeList[] trades = { new EmeraldForItems(MoDropsItems.salted_chicken_cooked, new PriceInfo(7, 10)), new ListItemForEmeralds(MoDropsItems.raw_horse_meat, new PriceInfo(-6, -2)) }; }
  24. new EmeraldForItems(MoDropsItems.salted_chicken_cooked, new PriceInfo(7, 10)), new ListItemForEmeralds(MoDropsItems.raw_horse_meat, new PriceInfo(-6, -2)) This is my attempt for the trades. The EmeraldForItems trade doesn't appear at all ingame.
  25. Ehm, how does one do that? Doesn't it want just one list?
×
×
  • Create New...

Important Information

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