Solved PlayerInteractEvent

Discussion in 'Plugin Development' started by PhilDEV_Acc, Jan 6, 2020.

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


    Im having a problem I want to code am Compass Menu with the RightClick event code:

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    public class RechtklickListner implements Listener {
        public void onEvent(PlayerInteractEvent event) {
            Player spieler = event.getPlayer();
            Action rechtcklick = event.getAction();
            if(rechtcklick == Action.RIGHT_CLICK_AIR) {
            ItemStack gegenstand = event.getItem();
            ItemMeta metaData = gegenstand.getItemMeta();
                if(metaData.getDisplayName().equals(ChatColor.DARK_BLUE + "Lobby Teleporter")) {
                    Bukkit.broadcastMessage("Das ist ein Lobby Teleporter");
    But It doesnt work and I made the Teleporter in the PlayerJoinEvent and you get it when you join the Server.

    Please Tell me how to fix it.
  2. Offline

    timtower Moderator Moderator

  3. Offline


    Ohhh my God Im so Stupid Sorry that I wasted your time:(
  4. Offline

    timtower Moderator Moderator

    Time enjoy wasting is not wasted time ;)
    Marked as solved.
Thread Status:
Not open for further replies.

Share This Page