Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onEnable()
- {
- getCommand("cube").setExecutor(new CommandExecutor() {
- public boolean onCommand(CommandSender sender, Command command, String str, String[] args)
- {
- if(sender instanceof Player)
- {
- Player p = (Player) sender;
- World world = p.getWorld();
- Location loc = p.getLocation();
- try
- {
- int lLim = Integer.parseInt(args[0]);
- int wLim = Integer.parseInt(args[1]);
- int hLim = Integer.parseInt(args[2]);
- for(int l = 0; l<lLim; l++)
- {
- for(int w = 0; w<wLim; w++)
- {
- for(int h = 0; h<hLim; h++)
- {
- Block b = world.getBlockAt((int)(loc.getX()+2+l), (int)(loc.getY()+2+w), (int)(loc.getZ()+2+h));
- b.setType(Material.GRASS);
- }
- }
- }
- }
- catch(Exception e)
- {
- }
- }
- return false;
- }
- });
- }
Add Comment
Please, Sign In to add comment