Solved AreaEffectCloud modifying and spawning

Discussion in 'Spigot Plugin Development' started by applesandoranges, Jun 15, 2016.

Thread Status:
Not open for further replies.
  1. Hello! as said above, I would like to spawn an AreaEffectCloud and modify it as it says in the Spigot docs here https://hub.spigotmc.org/javadocs/spigot How after marking this as an entity can i modify the data of the cloud such as the effect, the color, size, etc.

    I have this code below - thanks!

    Code (Text):
    public class AreaEffectCloud
    {
       
        public void spawnCloud(Player player)
        {
            player.getLocation().getWorld().spawnEntity(player.getLocation(), EntityType.AREA_EFFECT_CLOUD);      
            // how can i modify this cloud?  
        }
    }
     
  2. Code (Text):
    public class AreaEffectCloud
    {
     
        public void spawnCloud(Player player)
        {
           Entity cloud = player.getLocation().getWorld().spawnEntity(player.getLocation(), EntityType.AREA_EFFECT_CLOUD);      
            cloud.(some method);
        }
    }
     
  3. Bump

    Hey, thanks! It seems that code points the cloud to a normal entity such as a player. When I use cloud. I can actually set the cloud as OP haha.
    Something odd though, some of the methods that I see that show up in the Spigot docs don't show up such as color, and custom effects. Does anyone have any ideas for setting the color of the cloud, settings effects, etc.

    Thanks for any help I had a really cool idea for the AreaEffectCloud and would love to implement it into my plugin.
     
  4. Choco

    Moderator

    Cast it to an AreaEffectCloud instead of using an Entity
    Code (Java):
    AreaEffectCloud cloud = (AreaEffectCloud) player.getWorld().spawnEntity(player.getLocation(), EntityType.AREA_EFFECT_CLOUD);
     
    • Winner Winner x 2
Thread Status:
Not open for further replies.