WorldeditAPI region help

Discussion in 'Plugin Development' started by VictoryShot, Aug 5, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    VictoryShot

    Hello I need help with worldedit. When I enter a command it want it to set the player a 5x5 region within them without using a wand. Code:
    Code:java
    1. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    2. Player p = (Player) sender;
    3. if (!(sender instanceof Player)) {
    4. sender.sendMessage(ChatColor.RED + "The console cannot set up Welcome.");
    5. return true;
    6. }
    7. if (cmd.getName().equalsIgnoreCase("5x5")) {
    8. s = getWorldEdit().setSelection(p, p.getLocation().getX()+1);
    9. if (s == null) {
    10. sender.sendMessage(ChatColor.RED + "Make a selection!");
    11. return true;
    12. }
    13. sender.sendMessage(ChatColor.GREEN + "Area for 5x5 set");
    14. }
    15.  


    WorldeditAPI Is really confusing an I need help with this please thanks.
     
  2. Offline

    Dragonphase

  3. Offline

    VictoryShot

  4. Offline

    Dragonphase

    VictoryShot

    I assume you've already retrieved WorldEditPlugin.

    On first glance of the API, you should be able to do something like this:

    Code:java
    1. worldEditPlugin.setSelection(player, new CuboidSelection(player.getWorld(), player.getLocation().subtract(2, 2, 2), player.getLocation().add(2, 2, 2))); //Volume of the selection is 5^3


    I don't know much about the WorldEdit API, which is why I mentioned the WorldEdit forum, where you'll get better support from the members there.
     
  5. Offline

    VictoryShot

    That has a problem.

    Code:
    Type mismatch: cannot convert from void to Selection
     
Thread Status:
Not open for further replies.

Share This Page