Solved Distribute armorstands around a player in a circle

Discussion in 'Spigot Plugin Development' started by Manicraft1001, Feb 22, 2020.

Thread Status:
Not open for further replies.
  1. Hey guys,

    i want to create an circle with armorstands around an player.
    It would be perfect, if i just add an armorstand into an list and i can distribute them with an method.

    I made some examples in Excel, where the armorstands could be with an specific list size (the armorstands are in the gap):
    upload_2020-2-22_10-0-53.png
    upload_2020-2-22_10-2-37.png
    upload_2020-2-22_10-3-7.png

    Currently, i dont have alot ideas how i could do that. Any ideas or suggetions?
     
  2. 360º / armor stand amount
    and create the armor stands with that anle spacing
     
  3. I didn't create this, but helped me with particle stuff. Maybe you can use this:

    Code (Java):
        private List<Location> getCircle(Location center, int radius, int amount) {
            List<Location> list = Lists.newArrayList();
            for(int i = 0; i < amount; i++) {
                double a = 2 * Math.PI / amount * i;
                double x = Math.cos(a) * radius;
                double z = Math.sin(a) * radius;
                if(center.clone().add(x, 0, z).getBlock().isEmpty()) {
                    list.add(center.clone().add(x, 0, z));
                }
            }
            return list;
        }
     
    • Like Like x 1
  4. Thank you all guys for the reply.
    I finally found a solution by setting the rotation by 360/count and move them forward.
    I will now close the thread :)
     
Thread Status:
Not open for further replies.