小编use*_*462的帖子

令牌"else"上的语法错误

我对编码很新,我不断收到这个错误,我真的需要帮助.这是我的代码:

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
    if (stack.getItem() == halo.TitaniumHelmet || stack.getItem() == halo.TitaniumChestplate || stack.getItem() == halo.TitaniumBoots) {
        return "halo:textures/models/armor/Titanium1.png";
    }
    if (stack.getItem() == halo.TitaniumLeggings); {
        return "halo:textures/models/armor/Titanium_layar_2.png";
    } else { //<------ Syntax error on token "else", delete this token
        return null; 
    }
Run Code Online (Sandbox Code Playgroud)

java syntax-error

-2
推荐指数
1
解决办法
100
查看次数

标签 统计

java ×1

syntax-error ×1