Solved WorldEdit Cuboid Region

Discussion in 'Plugin Development' started by Xp10d3, Mar 5, 2021.

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

    Xp10d3

    Dumb question, but I have been taking a look at the documentation for WorldEdit API and don't know how to select a region. I am attempting to paste a schematic where the player is and then delete it after 5 seconds, but don't know how to select a region. I'm new to WorldEdit API (first time using) so sorry for the dumb question. This is my method:
    Code:java
    1.  
    2. private void cages(Player player) {
    3.  
    4. Location minlocation = new Location(player.getWorld(), player.getLocation().getX() + 15, player.getLocation().getY() + 15, player.getLocation().getZ() + 15);
    5. Location maxlocation = new Location(player.getWorld(), player.getLocation().getX() - 15, player.getLocation().getY() - 15, player.getLocation().getZ() - 15);
    6.  
    7. Vector pos1 = new Vector(player.getLocation().getX() + 15, player.getLocation().getY() + 15, player.getLocation().getZ() + 15);
    8. Vector pos2 = new Vector(player.getLocation().getX() - 15, player.getLocation().getY() - 15, player.getLocation().getZ() - 15);
    9.  
    10. //File saveTo = new File(core.getDataFolder() + File.separator + "Cages\\", "some_schem.yml");
    11. CuboidRegion region = new CuboidRegion(pos1, pos2);
    12. }
    13.  


    Based on what I see, CuboidRegion has the parameters Vector, Vector or World, Vector, Vector, however it I get the error The constructor CuboidRegion(Vector, Vector) is undefined. Again sorry for the dumb question.
     
  2. Online

    KarimAKL

    @Xp10d3 Did you import the wrong Vector class?
     
  3. Offline

    Xp10d3

    No I don't believe so.
    EDIT: Actually I did lol. Mb. Was using org.bukkit.util.Vector LOL. Mbmbmbmmbb
     
    KarimAKL likes this.
Thread Status:
Not open for further replies.

Share This Page