Player Death Event

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

Thread Status:
Not open for further replies.
  1. How would I create a smoke particle effect at the players location when they die?
     
  2. Offline

    Seadragon91

    Look here.
    player.getWorld().playEffect(...);
     
  3. On the death event though i am not able to get the players location
     
  4. Offline

    Seadragon91

    event.getEntity().getWorld() ?
    event.getEntity().getLocation() ?
     
  5. Offline

    Wolftic

    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

    Wolftic . That should work there, but you can also set sounds and other effects as long as it works with the event set.
     
Thread Status:
Not open for further replies.

Share This Page