When player kills enemy Sound and particles plays // Help.

Discussion in 'Programming' started by SenpaiDex, May 11, 2016.

  1. Hey Guys Im highly confused how to make this plugin work when donator kills a player
    A WOLF_HOWL plays and a RainbowParticles Plays

    heres the codes that i know only

    1. @EventHandler(priority=EventPriority.LOW)
    2. public void onPlayerDeath(PlayerDeathEvent event)
    3. {
    4. Player player = event.getEntity();
    5. player.getLocation().getWorld().playEffect(player.getLocation(), Effect.SMOKE, 1);
    6. }
    1. @EventHandler
    2. public void onKill(PlayerDeathEvent e)
    3. {
    4. Player player = event.getEntity();
    5. player.getLocation().getWorld().playEffect(player.getLocation(), Effect.SMOKE, 1);
    6. }


    permissions :
    1. String permission = getConfig().getString("donatorperk", "dontator.enable");
    2. if(!player.hasPermission(permission)) {
    3. player.sendMessage("You Don't Have Permissions!");
    4. } else {
    5. // idk
    6. }
    Can Somebody Complie this codes and send the full .jar and source code? thanks so much <3
     
  2. Use code tags. This hurts my eyes.
     
  3. Why would we write & pack it then send it to you? You're on the right track...

    - Listen for PlayerDeathEvent
    - Check if the player involved with the event has the permission
    - Player#playSound
    - 1.9: Player#spawnParticle
     
    • Useful Useful x 1
  4. can u compile everything and send the code?
    im kinda new to coding in spigot <3
    im still learning xD
     
  5. im still trying to fix this im trying what can i do :D
     
  6. Hey i did it but i have this getConfig() Error

    picture link : http://imgur.com/9gXD7VM