Problem with commands

Started by homchom on Tue, 02/03/2015 - 02:40

Topic category: Help with modding

Last seen on 18:50, 16. Jun 2018
Joined Jan 2015
User points:

User statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • Tracker tickets:
  • Mods of the week:
Problem with commands
Tue, 02/03/2015 - 02:44 (edited)

Hi. I'm trying to make a command on a mod for my server called /warp (no, not the same one as essentials!) when you excecute it it will print in chat, "Really? Warping is for noobs. Take the subway!" I have it setup so that there are 2 events on command excecution. First, it gives you an achievement called "Warp Fail", but only if HasWarpFail (a variable) is false. Then it sets the variable to true. That way you can only get it once. When i recompile it it says: "Error: Cannot find symbol" on if(!mcreator_VarListTestEnvironmentMod.isVariable

False[HasWarpFail]){. I can't find what i'm missing. Plz help if anyone knows what todo. Anyone know what's wrong?


Here's my code:

package mod.mcreator;//based on master condiguration   import cpw.mods.fml.client.*; import cpw.mods.fml.client.registry.*; import cpw.mods.fml.common.*; import cpw.mods.fml.common.asm.*; import cpw.mods.fml.common.asm.transformers.*; import cpw.mods.fml.common.discovery.*; import cpw.mods.fml.common.discovery.asm.*; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.functions.*; import*; import cpw.mods.fml.common.registry.*; import cpw.mods.fml.common.toposort.*; import cpw.mods.fml.common.versioning.*; import cpw.mods.fml.relauncher.*; import cpw.mods.fml.server.*; import net.minecraft.block.*; import net.minecraft.block.material.*; import net.minecraft.client.*; import*; import net.minecraft.client.entity.*; import net.minecraft.client.gui.*; import net.minecraft.client.gui.achievement.*; import net.minecraft.client.gui.inventory.*; import net.minecraft.client.model.*; import net.minecraft.client.multiplayer.*; import net.minecraft.client.particle.*; import net.minecraft.client.renderer.*; import net.minecraft.client.renderer.culling.*; import net.minecraft.client.renderer.entity.*; import net.minecraft.client.renderer.tileentity.*; import net.minecraft.client.settings.*; import net.minecraft.command.*; import net.minecraft.crash.*; import net.minecraft.creativetab.*; import net.minecraft.dispenser.*; import net.minecraft.enchantment.*; import net.minecraft.entity.*; import*; import net.minecraft.entity.boss.*; import net.minecraft.entity.effect.*; import net.minecraft.entity.item.*; import*; import net.minecraft.entity.passive.*; import net.minecraft.entity.player.*; import net.minecraft.entity.projectile.*; import net.minecraft.inventory.*; import net.minecraft.item.*; import net.minecraft.item.crafting.*; import net.minecraft.nbt.*; import*; import*; import net.minecraft.pathfinding.*; import net.minecraft.potion.*; import net.minecraft.profiler.*; import net.minecraft.server.*; import net.minecraft.server.dedicated.*; import net.minecraft.server.gui.*; import net.minecraft.server.integrated.*; import*; import net.minecraft.src.*; import net.minecraft.stats.*; import net.minecraft.tileentity.*; import net.minecraft.util.*; import net.minecraft.village.*; import*; import*; import*; import*; import*; import*; import*; import*; import*; import*; import net.minecraftforge.classloading.*; import net.minecraftforge.client.*; import net.minecraftforge.client.event.*; import net.minecraftforge.client.event.sound.*; import net.minecraftforge.common.*; import net.minecraftforge.event.*; import net.minecraftforge.event.entity.*; import net.minecraftforge.event.entity.item.*; import*; import net.minecraftforge.event.entity.minecart.*; import net.minecraftforge.event.entity.player.*; import net.minecraftforge.event.terraingen.*; import*; import net.minecraftforge.oredict.*; import net.minecraftforge.transformers.*; import net.minecraft.init.*; import java.util.Random;   public class mcreator_warp{   public static Object instance;   public mcreator_warp(){}   public void load(){}   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 registerRenderers(){} public void serverLoad(FMLServerStartingEvent event){   event.registerServerCommand(new Commandwarp());   } public void preInit(FMLPreInitializationEvent event){}   class Commandwarp implements ICommand{ public boolean isUsernameIndex(int var1){ return false; } public boolean canCommandSenderUseCommand(ICommandSender var1){ return true; } public java.util.List getCommandAliases(){ return null; } public java.util.List addTabCompletionOptions(ICommandSender var1, String[] var2){ return null; }   public boolean isUsernameIndex(String[] string, int index){ return true; } public String getCommandName(){ return "warp"; } public String getCommandUsage(ICommandSender var1){ return "/warp Warp to places."; } public int compareTo(Object c){ return -1; } public void processCommand(ICommandSender var1, String[] cmd){ int i = var1.getPlayerCoordinates().posX; int j = var1.getPlayerCoordinates().posY; int k = var1.getPlayerCoordinates().posZ; EntityPlayer entity = (EntityPlayer)var1;     World world = null; WorldServer[] list = MinecraftServer.getServer().worldServers; for(WorldServer ins : list){ if(ins.provider.dimensionId==entity.worldObj.provider.dimensionId) world = ins; } if(world==null) world = list[0];     var1.addChatMessage(new ChatComponentText("Really? Warping is for noobs. Take the subway!"));   if(!mcreator_VarListTestEnvironmentMod.isVariable False[HasWarpFail]){ //this is the part that is giving an error if(entity instanceof EntityPlayer)((EntityPlayer)entity).addStat(mcreator_warpFail.achievement, 1); }   if(true){ mcreator_VarListTestEnvironmentMod.HasWarpFail = true; }   }   }     }  
Edited by homchom on Tue, 02/03/2015 - 02:44
0Upvote this forum topic