Guest User

Untitled

a guest
Jan 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public void onEnable()
  2. {
  3. getCommand("cube").setExecutor(new CommandExecutor() {
  4.  
  5. public boolean onCommand(CommandSender sender, Command command, String str, String[] args)
  6. {
  7. if(sender instanceof Player)
  8. {
  9. Player p = (Player) sender;
  10. World world = p.getWorld();
  11. Location loc = p.getLocation();
  12. try
  13. {
  14. int lLim = Integer.parseInt(args[0]);
  15. int wLim = Integer.parseInt(args[1]);
  16. int hLim = Integer.parseInt(args[2]);
  17. for(int l = 0; l<lLim; l++)
  18. {
  19. for(int w = 0; w<wLim; w++)
  20. {
  21. for(int h = 0; h<hLim; h++)
  22. {
  23. Block b = world.getBlockAt((int)(loc.getX()+2+l), (int)(loc.getY()+2+w), (int)(loc.getZ()+2+h));
  24. b.setType(Material.GRASS);
  25. }
  26. }
  27. }
  28. }
  29. catch(Exception e)
  30. {
  31.  
  32. }
  33. }
  34.  
  35. return false;
  36.  
  37. }
  38.  
  39.  
  40. });
  41.  
  42. }
Add Comment
Please, Sign In to add comment