gpt4 book ai didi

java - 错误 token 上的语法错误 ";", , 预期 - Minecraft

转载 作者:行者123 更新时间:2023-11-30 04:11:39 26 4
gpt4 key购买 nike

我正在创建 Minecraft mod,并且收到错误“ token “;”上的语法错误,预计在这一行”

public static Block BasaltSmooth;

这是代码:

package BitBox.Mods.BetterEgg;

import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "BitBox's Mod", name = "BitBoxMod", version = "V0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class mainClass {
// Initialization

//tabs
public static Item BitBoxTabIcon;

//items

//blocks
public static Block BasaltSmooth;

BasaltSmooth = new BitBoxBlock(500, Material.rock)
.setHardness(0.5F)
.setUnlocalizedName("Basalt Stone")
.setCreativeTab(CreativeTabs.tabBlock);

public static CreativeTabs bitBoxTab;

@EventHandler
public void load(FMLInitializationEvent event) {
LanguageRegistry.addName(BasaltSmooth, "Basalt Stone");
MinecraftForge.setBlockHarvestLevel(BasaltSmooth, "pickaxe", 0);
GameRegistry.registerBlock(BasaltSmooth, "Basalt Stone");
}

public mainClass() {
}
}

最佳答案

你不能这样做

public static Block BasaltSmooth;

BasaltSmooth = new BitBoxBlock(500, Material.rock).setHardness(0.5F).setUnlocalizedName("Basalt
Stone").setCreativeTab(CreativeTabs.tabBlock);

这样做

public static Block BasaltSmooth = new BitBoxBlock(500, Material.rock).setHardness(0.5F).setUnlocalizedName("Basalt            
Stone").setCreativeTab(CreativeTabs.tabBlock);

关于java - 错误 token 上的语法错误 ";", , 预期 - Minecraft,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19466589/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com