Status Effect At Spawn?

Discussion in 'Archived: Plugin Requests' started by Nikk96, Apr 17, 2013.

  1. Offline

    Nikk96

    hello, i am in need of a plugin, that adds certain status effects in spawn, configurable levels and i would like it to be linked to world guard reigions? ive found THIS plugin, but i need the configurable levels. could anybody help me out?
     
  2. Offline

    Celeo

    I'll cover this for you.​

    Enjoy.

    .JAR: https://dl.dropboxusercontent.com/u/11962432/Code/SpawnEffects.jar
    Code: https://github.com/Celeo/SpawnEffects
    Configuration:
    Commands:
    • /spawneffects reload: Reloads the settings from the configuration file. Player either needs to be a server OP or have the permission "spawneffects.reload"

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  3. Offline

    Zarius

    Nikk96

    I can see that Celeo's created a plugin for you but your initial post is a little ambiguous. Do you want to effects to apply only on player respawn (if they respawn in a particular region) or do you want them to be continuous whilst the player is in that region.

    Also, do you need support for multiple regions with varying potioneffects or just one specific region?

    Celeo

    Nice quick turnaround :) Please note though that Nikk96 wanted configurable levels. Also, probably better to allow the player to specific a list of potion effects that you can then validate in the code - this would allow you to automatically support any new potioneffects that might be added.

    @Bothpeople (hopefully that's not a user's name :D)

    Check out OtherBounds for examples and/or possible solution as it allows multiple potion effects with configurable level and allows multiple regions to be specified. Note: need to set the boundaries to be "inverted" and the potion effect will be continuous whilst in the region.

    If you've only looking for potioneffects on respawn check out OtherDrops, here's an example config:

    PHP:
      PLAYER:
        - 
    actionPLAYERRESPAWN
          potioneffects
    : [SPEED@200@3]  # level 3 speed for 10 seconds
          
    regions: [myregion]  # optional: limit to particular regions
     
  4. Offline

    Celeo

    If you had read the code you would see

    Code:
    private void load()
    {
        reloadConfig();
        spawnRegion = getConfig().getString("spawnRegion", "spawn");
        String p = "";
        for (PotionEffectType effect : PotionEffectType.values())
        {
            if (effect == null)
                continue;
            p = "effects." + effect.getName().toLowerCase();
            if (getConfig().isSet(p) && getConfig().getBoolean(p))
                effects.add(effect);
        }
        getLogger().info("Settings loaded from configuration file");
    }
     
  5. Offline

    Zarius

    Celeo

    Why do you assume I didn't read the code? :) I just didn't notice that - sorry.

    Still, you should add custom levels to the plugin because otherwise it's basically identical to LegendarySpawnEffects.
     
  6. Offline

    Celeo

Share This Page