Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Source Very simple Bind Command

Apple26j

New member
Joined
Apr 19, 2022
Messages
132
Reaction score
12
Points
0
You will need to change most of the code according to your client base/command base.
Code:
package apple.commands;

import org.lwjgl.input.Keyboard;

import apple.Apple;
import apple.interfaces.CommandInterface;

@CommandInterface(name = "bind", help = "§9.bind §9(module) §9(key)")
public class Bind extends Command
{
    @Override
    public void onCommand (String [] arguments)
    {
        super.onCommand(arguments);
      
        if (arguments.length != 2)
        {
            Apple.INSTANCE.addChatComponentMessage(getHelp());
          
        }
      
        else
        {
            try
            {
                Apple.INSTANCE.getModuleManager().getModule(arguments[0]).setKey(Keyboard.getKeyIndex(arguments[1].toUpperCase()));
                Apple.INSTANCE.addChatComponentMessage("§aBound §a" + Apple.INSTANCE.getModuleManager().getModule(arguments[0]).getName() + " §ato §a" + Keyboard.getKeyName(Apple.INSTANCE.getModuleManager().getModule(arguments[0]).getKey()) + ".");
              
            }
          
            catch (NullPointerException nullPointerException)
            {
                Apple.INSTANCE.addChatComponentMessage(getHelp());
              
            }
          
        }
      
    }
  
}
The reason why I posted this is for some odd reason, people find it difficult to make the bind command.
Anyways, enjoy! :)

// edit: changed to the right code tags (dirt)
 
Last edited by a moderator:
You will need to change most of the code according to your client base/command base.
package apple.commands; import org.lwjgl.input.Keyboard; import apple.Apple; import apple.interfaces.CommandInterface; @CommandInterface(name = "bind", help = "§9.bind §9(module) §9(key)") public class Bind extends Command { @Override public void onCommand (String [] arguments) { super.onCommand(arguments); if (arguments.length != 2) { Apple.INSTANCE.addChatComponentMessage(getHelp()); } else { try { Apple.INSTANCE.getModuleManager().getModule(arguments[0]).setKey(Keyboard.getKeyIndex(arguments[1].toUpperCase())); Apple.INSTANCE.addChatComponentMessage("§aBound §a" + Apple.INSTANCE.getModuleManager().getModule(arguments[0]).getName() + " §ato §a" + Keyboard.getKeyName(Apple.INSTANCE.getModuleManager().getModule(arguments[0]).getKey()) + "."); } catch (NullPointerException nullPointerException) { Apple.INSTANCE.addChatComponentMessage(getHelp()); } } } }
The reason why I posted this is for some odd reason, people find it difficult to make the bind command.
Anyways, enjoy! :)
good job
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top