[SOLVED] Particle effects from config

Discussion in 'Spigot Plugin Development' started by Karatechimp29, Jul 11, 2015.

  1. Hey All, i basically want to grab an effect type from a config, example of config:
    Code (Text):
    ParticleEffect: SNOW_SHOVEL
    and then use the effect with:
    Code (Text):
    playCircularEffect(player.getLocation(), Effect.<config>, false);
    how can i achieve this?
  2. Code (Text):
    Effect.valueOf(String paramString);
    Code (Text):
    Effect.getByName(String paramString);
    • Like Like x 1
  3. Code (Text):
    playEffect(player.getLocation(), String Effect, 0);
    to get the string at config do

    Code (Text):

    // config.yml

    Message: 'Message'
  4. ok i have done this
    Code (Text):
                                            playCircularEffect(player.getLocation(), Effect.valueOf(getConfig().getString("Effects.ParticleType")), false);
    their are no particles...
  5. Give code of method 'playCircularEffect'.
  6. Code (Text):
        public void playCircularEffect(Location location, Effect effect, boolean v){
            for(int i = 0; i <=8; i += ((!v && (i==3)) ? 2 : 1))
                    location.getWorld().playEffect(location, effect, i);
    May i point out that this method worked when i was providing the effect through the code, ever since i tried grabbing it from config i get "could not parse event"