简体   繁体   中英

Why is my minecraft forge mod not working?

I am trying to make a custom biome, but it crashes when I try to export the mod and load it in Minecraft. It works fine in eclipse 'run client' mode.

Here is the code:

package com.dadobug1111.FarmlandBiome.world.biome;

import net.minecraft.init.Blocks;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeForest;
import net.minecraft.world.gen.feature.WorldGenMinable;

public class BiomeFarmland extends Biome {

    public BiomeFarmland() {
        super(new Biome.BiomeProperties("FarmlandBiome")
            .setHeightVariation(0.004F)
            .setTemperature(0.8F)
            .setRainfall(0.4F)
            .setBaseHeight(0F)
        );

        this.decorator.treesPerChunk = 1/5;
        this.decorator.sandPatchesPerChunk = 0;
        this.decorator.gravelPatchesPerChunk = 0;
        this.decorator.generateFalls = true;
     }

}

The crash log is here .

Relevant message:

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Farmland Biome (farmlandbiomemod) Caused by: java.lang.NoSuchMethodError: net.minecraft.world.biome.Biome$BiomeProperties.setHeightVariation(F)Lnet/minecraft/world/biome/Biome$BiomeProperties;

I know it has something to do with how I add biome properties, but I do not know why.

My Minecraft forge version is forge-1.12.2-14.23.5.2768

I was exporting incorrectly. I used the export feature of eclipse, instead of opening command prompt and using gradlew build. It works now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM