Answers for "create commands bukkit"

0

bukkit register commands

public class main {
  @Override
  public void onEnable() {
      this.getCommand("heal").setExecuter(new health(this));
      //E.g a heal command in class health
      // this.getCommand("heal").setExecture(new health(this))

      //If command in main class replace new <class>() with this.
      // this.getCommand("heal").setExecuter(this)
  }
}

//If in external class a constructor has to be made.
public class health {
  private main plugin;
  //Have to create constructor in external class
  public health(main plugin) { this.plugin = plugin; }  
  
  public boolean onCommand(CommandSender sender, Command cmd, String Label, String[] args) { 
  	//Do stuff
  }
  
}
Posted by: Guest on April-15-2020
0

Java Bukkit

Basics 1:
- Java Plugin implementieren:
	
	public void Main extends JavaPlugin{
    }

- Wenn Aktiviert (onEnbale) Methode erstellen:

	public void Main extends JavaPlugin{
      
     	public void onEnable(){
      	}
    }

- Konsolen anzeige in onEnable Methode:

	public void Main extends JavaPlugin{
      
     	public void onEnable(){
          System.out.println("Das Plugin wurde aktiviert.");
      	}
    }
Posted by: Guest on November-28-2020
0

bukkit register commands

public class main {
  @Override
  public void onEnable() {
      this.getCommand("heal").setExecuter(new health(this));
      //E.g a heal command in class health
      // this.getCommand("heal").setExecture(new health(this))

      //If command in main class replace new <class>() with this.
      // this.getCommand("heal").setExecuter(this)
  }
}

//If in external class a constructor has to be made.
public class health {
  private main plugin;
  //Have to create constructor in external class
  public health(main plugin) { this.plugin = plugin; }  
  
  public boolean onCommand(CommandSender sender, Command cmd, String Label, String[] args) { 
  	//Do stuff
  }
  
}
Posted by: Guest on April-15-2020
0

Java Bukkit

Basics 1:
- Java Plugin implementieren:
	
	public void Main extends JavaPlugin{
    }

- Wenn Aktiviert (onEnbale) Methode erstellen:

	public void Main extends JavaPlugin{
      
     	public void onEnable(){
      	}
    }

- Konsolen anzeige in onEnable Methode:

	public void Main extends JavaPlugin{
      
     	public void onEnable(){
          System.out.println("Das Plugin wurde aktiviert.");
      	}
    }
Posted by: Guest on November-28-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language