Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.xmta.test;
- import net.minecraft.server.v1_4_6.World;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.*;
- import org.bukkit.block.*;
- import org.bukkit.entity.*;
- import org.bukkit.plugin.java.JavaPlugin;
- public class testclass extends JavaPlugin
- {
- @Override
- public void onEnable()
- {
- getLogger().info("Test Plugin by Noneatme Loadet!");
- }
- @Override
- public void onDisable()
- {
- // TODO Insert logic to be performed when the plugin is disabled
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
- {
- if(cmd.getName().equalsIgnoreCase("xinfo")){ // If the player typed /basic then do the following...
- sender.sendMessage(ChatColor.AQUA + "Projekt X Member:");
- sender.sendMessage(ChatColor.GREEN + "Dawi(Regio), Jake, Noneatme(Multivan)");
- return true;
- } //If this has happened the function will return true.
- // AMBOSS
- if(cmd.getName().equalsIgnoreCase("xamboss"))
- {
- if(args.length > 0)
- {
- Player target = (Bukkit.getServer().getPlayer(args[0]));
- if(target == null)
- {
- sender.sendMessage(ChatColor.RED + "Spieler nicht gefunden!");
- return false;
- }
- else
- {
- Location loc = target.getLocation();
- int x = loc.getBlockX(); // Set the startpoints to the coordinates of the given location
- int y = loc.getBlockY();
- int z = loc.getBlockZ();
- loc.setY(y+5);
- Block b = loc.getBlock();
- b.setTypeId(145);
- this.getServer().broadcastMessage(ChatColor.RED + target.getDisplayName() + " wurde geambosst.");
- return true;
- }
- }
- }
- else
- {
- sender.sendMessage(ChatColor.RED + "Du musst ein Spieler angeben!");
- return false;
- }
- // If this hasn't happened the a value of false will be returned.
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment