Solved Create circle area

Discussion in 'Plugin Development' started by baenii, Oct 29, 2019.

Thread Status:
Not open for further replies.
  1. Hej everyone,

    I'm currently coding a plugin for own purposes. I want to create a circle area to prevent players from getting damage while in this area.

    I thought about something like this:

    Code:
    //Pseudo-Code
    
    Area spawnArea = Bukkit.getServer().getWorld("world").getSpawnLocation().addRadius(40);
    
    if(p.getLocation().getArea() == spawnArea) {
         //Cancel damage etc.
    }
    
    Thanks!
     
  2. Offline

    timtower Administrator Administrator Moderator

    @baenii Check the distance to the spawn location.
     
    baenii likes this.
  3. Whoops that's too smart to come into my mind. Thanks Tim!
     
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page