I always get recompilation errors, don't know why.

Started by Pare06 on

Topic category: Troubleshooting, bugs, and solutions

Joined Oct 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I always get recompilation errors, don't know why.

I'm creating my first mod, but i always get recompilation errors because of an item. I checked if it hadn't errors, but i can't fix it. Can someone help me? I'm using MCreator 1.7.6. 

Item's code:

package mod.mcreator;

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraft.world.World;
import net.minecraft.util.ResourceLocation;
import net.minecraft.potion.PotionEffect;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.init.MobEffects;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.Entity;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.Block;

import java.util.Random;

@SuppressWarnings("unchecked")
public class mcreator_rItem {

    public mcreator_rItem() {
    }

    public static Item block;
    public static Object instance;

    public void load(FMLInitializationEvent event) {
        if (event.getSide() == Side.CLIENT)
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(block, 0, new ModelResourceLocation("modname:RItem", "inventory"));

        GameRegistry.addShapedRecipe(new ResourceLocation("modname:ritem"), new ResourceLocation("custom"), new ItemStack(block, 1),
                new Object[]{"   ", " 4 ", "   ", Character.valueOf('4'), mcreator_rBlock.block,});
        GameRegistry.addSmelting(mcreator_rOre.block, new ItemStack(block), 1.0f);
    }

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
    }

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
    }

    public void registerRenderers() {
    }

    static {
        block = (new ItemrItem());

    }

    static class ItemrItem extends Item {

        public ItemrItem() {
            setMaxDamage(0);
            maxStackSize = 64;
            setUnlocalizedName("RItem");
            setRegistryName("RItem");
            ForgeRegistries.ITEMS.register(this);
            setCreativeTab(mcreator_creativeTab.tab);
        }

        @Override
        public int getItemEnchantability() {
            return 0;
        }

        @Override
        public int getMaxItemUseDuration(ItemStack par1ItemStack) {
            return 0;
        }

        @Override
        public float getStrVsBlock(ItemStack par1ItemStack, IBlockState par2Block) {
            return 1.0F;
        }

        

        @Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean par5) {
int i = (int)entity.posX;
int j = (int)entity.posY;
int k = (int)entity.posZ;

 

(sorry for bad english, I'm not very good)

 

Joined Oct 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What do you mean? That is a …
Wed, 11/07/2018 - 19:51

What do you mean? That is a .java file.

Where's the error stuff?

Also, I use pastebin.com for posting and pasting text that can actually be very long, like java code, and log files, and many other files as well.