Solved InteractEvent is not working somehow

Discussion in 'Plugin Development' started by jinhoftyu, Apr 18, 2021.

  1. Offline

    jinhoftyu

    This playerinteractevent is not working.
    Code:
    @EventHandler
        public void onZombieTP(PlayerInteractEvent e) {
            Player p = e.getPlayer();
            Action a = e.getAction();
            if (a == Action.RIGHT_CLICK_BLOCK || e.getItem().getType() == Material.DIAMOND) {
                p.getInventory().remove(Material.DIAMOND);
                p.setCooldown(Material.DIAMOND, 60);
            }
        }
    Also I had already registered the event. (The class name is Team)
    Bukkit.getPluginManager().registerEvents(new Team(), this);

    What is wrong?
     
    Last edited by a moderator: Apr 18, 2021
  2. Offline

    timtower Administrator Administrator Moderator

    @jinhoftyu Can you add a sendMessage in the first line?
     
  3. Offline

    jinhoftyu

    ok thanks
    somehow it worked
     

Share This Page