No Error but not working? EventHandler

Discussion in 'Plugin Development' started by FightManiac, Jan 23, 2014.

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

    FightManiac

    There is no errors but isn't working i don't know what i did wrong?
    It should send the message and give speed to the player.

    Code:java
    1. package as.FightManiac.TEST;
    2.  
    3. import org.bukkit.ChatColor;
    4. import org.bukkit.Material;
    5. import org.bukkit.entity.Player;
    6. import org.bukkit.event.EventHandler;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.block.Action;
    9. import org.bukkit.event.player.PlayerInteractEvent;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11. import org.bukkit.potion.PotionEffect;
    12. import org.bukkit.potion.PotionEffectType;
    13.  
    14. public class Test extends JavaPlugin implements Listener{
    15.  
    16.  
    17.  
    18. public void onEnable(){
    19. getLogger().info("TEST ON MESSAGE");
    20.  
    21.  
    22. }
    23.  
    24.  
    25. public void onDisable() {
    26.  
    27. }
    28.  
    29. @EventHandler
    30. public void Abilities(PlayerInteractEvent event) {
    31. Player player = event.getPlayer();
    32. if ((event.getAction() == Action.RIGHT_CLICK_AIR) || (event.getAction() == Action.RIGHT_CLICK_BLOCK))
    33. {
    34. if (player.getInventory().getItemInHand().getType() == Material.FEATHER)
    35. {
    36. player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 200, 3));
    37. player.sendMessage(ChatColor.DARK_GREEN + "TEST MESSAGE");
    38. {
    39. }
    40. }
    41. }
    42. }
    43. }
     
  2. Offline

    L33m4n123

  3. Offline

    FightManiac

Thread Status:
Not open for further replies.

Share This Page