{HELP} Create Spawner Particles On Death Once Re spawned

Discussion in 'Plugin Development' started by Bc1151, Sep 23, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Bc1151

    i know this is wrong but this is what i have:

    public <T> void playEffect (Location loc, Effect effect, T data, Player player){
    if (!player.hasPermission("Bc1151.regen")) {
    if (player.isDead()){
    World world = player.getWorld();

    world.playEffect(player.getLocation(),Effect.MOBSPAWNER_FLAMES,data);

    }
    }
    }

    guys?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  2. Offline

    Jnorr44

    what is <T> used for?
    just do:
    public void playEffect(Location loc, Effect effect, Player player, int data) {
    if (!player.hasPermission("Bc1151.regen") && player.isDead()) {
    player.getWorld().playEffect(loc, effect, data);//data may be a float (don't remember), if so, just cast to float.
    }
    }

    Data is just the way the effect is facing, so it may not really be relevant.
     
  3. Offline

    sgavster

    Code:java
    1. player.getWorld().playEffect(player.getLocation(),Effect.MOBSPAWNER_FLAMES, 1);
     
Thread Status:
Not open for further replies.

Share This Page