Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package you.yourcode.Command;
- //REMEMBER YOU NEED A PLUGIN YML TO LOAD THE COMMANDS!
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class Command extends JavaPlugin {
- @Override
- public void onDisable() {
- System.out.println("[Command] Plugin deaktiviert!");
- }
- @Override
- public void onEnable() {
- //laden von Event Dingsta
- registerEvent();
- PluginDescriptionFile descFile = this.getDescription();
- System.out.println("[Command] Code written by _chunk__");
- System.out.println("[Command] Version: " + descFile.getVersion());
- System.out.println("[Command] Write what you want!");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String cmdLabel, String[] args){
- boolean erfolg = false;
- Player p = (Player)sender;
- if(cmd.getName().equalsIgnoreCase("YOURINGAMECOMMAND")){
- if(args.length == 0){
- float health = p.getHealth();
- p.sendMessage(ChatColor.RED + "[Command] " + ChatColor.AQUA + "Deine Gesundheit: " + health);
- p.setHealth(20);
- p.sendMessage(ChatColor.RED + "[Command] " + ChatColor.AQUA + "Du wurdest geheilt!");
- p.addPotionEffect(new PotionEffect(PotionEffectType.HUNGER, 500, 1));
- erfolg = true;
- }
- else
- {
- erfolg = false;
- }
- }
- return erfolg;
- }
- //Event-Teil
- private void registerEvent(){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment