Noneatme

Untitled

Jan 1st, 2013
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.09 KB | None | 0 0
  1. package de.xmta.test;
  2.  
  3.  
  4. import net.minecraft.server.v1_4_6.World;
  5.  
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.*;
  9.  
  10. import org.bukkit.block.*;
  11. import org.bukkit.entity.*;
  12. import org.bukkit.plugin.java.JavaPlugin;
  13.  
  14.  
  15. public class testclass extends JavaPlugin
  16.     {
  17.  
  18.     @Override
  19.     public void onEnable()
  20.     {
  21.  
  22.         getLogger().info("Test Plugin by Noneatme Loadet!");
  23.     }
  24.  
  25.     @Override
  26.     public void onDisable()
  27.     {
  28.         // TODO Insert logic to be performed when the plugin is disabled
  29.  
  30.     }
  31.    
  32.    
  33.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  34.     {
  35.         if(cmd.getName().equalsIgnoreCase("xinfo")){ // If the player typed /basic then do the following...
  36.             sender.sendMessage(ChatColor.AQUA + "Projekt X Member:");
  37.             sender.sendMessage(ChatColor.GREEN + "Dawi(Regio), Jake, Noneatme(Multivan)");
  38.             return true;
  39.         } //If this has happened the function will return true.
  40.        
  41.         // AMBOSS
  42.         if(cmd.getName().equalsIgnoreCase("xamboss"))
  43.         {
  44.                 if(args.length > 0)
  45.                 {
  46.                     Player target = (Bukkit.getServer().getPlayer(args[0]));
  47.                     if(target == null)
  48.                     {
  49.                         sender.sendMessage(ChatColor.RED + "Spieler nicht gefunden!");
  50.                         return false;
  51.                     }
  52.                     else
  53.                     {
  54.                         Location loc = target.getLocation();
  55.                        
  56.                         int x = loc.getBlockX();     // Set the startpoints to the coordinates of the given location
  57.                         int y = loc.getBlockY();
  58.                         int z = loc.getBlockZ();
  59.                         loc.setY(y+5);
  60.                         Block b = loc.getBlock();
  61.                         b.setTypeId(145);
  62.                         this.getServer().broadcastMessage(ChatColor.RED + target.getDisplayName() + " wurde geambosst.");
  63.                         return true;
  64.                     }
  65.                    
  66.                     }
  67.                 }
  68.                 else
  69.                 {
  70.                     sender.sendMessage(ChatColor.RED + "Du musst ein Spieler angeben!");
  71.                     return false;
  72.                 }
  73.             // If this hasn't happened the a value of false will be returned.
  74.         return false;
  75.    }
  76.  
  77.  
  78. }
Advertisement
Add Comment
Please, Sign In to add comment