Player Death Event

Discussion in 'Plugin Development' started by MckenzieSkullKid, Feb 16, 2013.

  1. Offline

    MckenzieSkullKid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    How would I create a smoke particle effect at the players location when they die?
  2. Offline

    Seadragon91

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Look here.
    player.getWorld().playEffect(...);

    This post has been edited 1 time. It was last edited by Seadragon91 Feb 16, 2013.
  3. Offline

    MckenzieSkullKid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    On the death event though i am not able to get the players location
  4. Offline

    Seadragon91

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    event.getEntity().getWorld() ?
    event.getEntity().getLocation() ?

    This post has been edited 1 time. It was last edited by Seadragon91 Feb 16, 2013.
  5. Offline

    Wolftic

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Code:
        @EventHandler(priority=EventPriority.LOW)
        public void onPlayerDeath(PlayerDeathEvent event)
        {
            Player player = event.getEntity();
            player.getLocation().getWorld().playEffect(player.getLocation(), Effect.SMOKE, 1);
        }
    Maybe this works, haven't tested it.
  6. Offline

    kreashenz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Wolftic . That should work there, but you can also set sounds and other effects as long as it works with the event set.

Share This Page