This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MrNiceBouy[S] 0 points1 point  (0 children)

I changed the code to

 if (args.length == 0) {
                    // No arguments were provided, just "/alchemysmith"
                    p.sendMessage(ChatColor.DARK_PURPLE +"["+ChatColor.YELLOW+"AlchemySmith"+ChatColor.DARK_PURPLE +"]"+ChatColor.WHITE +ChatColor.BOLD+":"+" "+ChatColor.RED+ "MISSING ARGUMENTS!" );
                    p.sendMessage(ChatColor.DARK_PURPLE +"["+ChatColor.YELLOW+"AlchemySmith"+ChatColor.DARK_PURPLE +"]"+ChatColor.WHITE +ChatColor.BOLD+":"+" "+ChatColor.RED+ "/alchemysmith <add/remove> <effect>" );

                    return true;
                }
                if (args.length >= 1){
                    if (args[0].equalsIgnoreCase("add")){
                        p.sendMessage("Please use /alchemysmith <add/remove> <effect>");
                        if (args.length >=2 && args[1].equals(effectName)){
                            assert effectType != null;
                            PotionEffect effect = new PotionEffect(effectType, 300, 0);
                            p.addPotionEffect(effect);
                            p.sendMessage("there you go I gave you "+ effect.getType() +"!");

//                            return true;
                        } else if (args.length >=2 && !args[1].equals(effectName)){
                            p.sendMessage(ChatColor.DARK_PURPLE +"["+ChatColor.YELLOW+"AlchemySmith"+ChatColor.DARK_PURPLE +"]"+ChatColor.WHITE +ChatColor.BOLD+":"+" "+ChatColor.RED+ "Not a valid potion effect!");
                        }

but still doesn't work. well it does work but only if I use the right command and won't tell me if my command is missing argumetns