Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tgdrei;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class tgdreiprogrammieren extends JavaPlugin {
- public void onEnable () {
- loadConfig();
- System.out.println("[tgdrei] started succesful!");
- }
- public void onDisable () {
- System.out.println("[tgdrei] stopped succesful!");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String cmdLabel, String [] args) {
- //heal
- Player p = (Player) sender;
- if (cmd.getName().equalsIgnoreCase("heal")) {
- if (p.hasPermission("tgdrei.heal")) {
- if(args.length == 0) {
- p.sendMessage("ยงaYou were succesfull healed!");
- p.setHealth(20);
- p.setFoodLevel(20);
- }
- if (args.length == 1) {
- Player p2 = getServer().getPlayer(args[0]);
- p2.setHealth(20);
- p2.setFoodLevel(20);
- p.sendMessage(ChatColor.GREEN + p2.getName() + " ยงawas succesfull healed");
- p2.sendMessage(" ยงaYou were healed by" + ChatColor.GREEN + p2.getName());
- //Superwalk
- }
- }
- return true;
- }
- else {
- return false;
- }
- if (cmd.getName().equalsIgnoreCase("superwalk")) {
- if (p.hasPermission("tgdrei.superwalk")) {
- if (args.length == 0);
- p.sendMessage("You activited Superwalk succesful. Type /superwalkoff to stop it.");
- p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 99999, 127));
- }
- //Superwalk remove
- if (cmd.getName().equalsIgnoreCase("superwalkoff")) {
- if (p.hasPermission("tgdrei.superwalkoff")) {
- if (args.length == 0);
- p.sendMessage("You deactivited Superwalk succesful. Type /superwalk to turn it on.");
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment