0 error my does not work

Discussion in 'Spigot Help' started by DevAnoynme, May 10, 2020.

  1. When I try to open a menu this does not open
    Code (Text):
    package magihub.gui;

    import java.util.Arrays;

    import org.bukkit.Bukkit;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.inventory.Inventory;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;

    public class Navigateur implements Listener {

        public void onInteract(PlayerInteractEvent e) {
            Player p = e.getPlayer();
            Action action = e.getAction();
            ItemStack is = e.getItem();
         
            if(is.getType() == Material.COMPASS && is.hasItemMeta() && is.getItemMeta().hasDisplayName() && is.getItemMeta().getDisplayName().equalsIgnoreCase("§8» §6Navigateur §8«")) {
                if(action == Action.RIGHT_CLICK_AIR) {
                    Inventory inv = Bukkit.createInventory(null, 9, "» Navigateur «");
                 
                    ItemStack hikabrain1 = new ItemStack(Material.SANDSTONE);
                    ItemMeta hikabrain2 = hikabrain1.getItemMeta();
                    hikabrain2.setDisplayName("§f§lBRAIN §8§l//");
                    hikabrain2.setLore(Arrays.asList("§fBut du jeu:", "§7§oLe 1er joueur à §a5 points", "§7§ogagne la partie !", "§7§o", "§a» §fCliquez pour rejoindre !"));
                    hikabrain1.setItemMeta(hikabrain2);
                 
                 
                 
                    inv.setItem(0, hikabrain1);
                 
                    p.openInventory(inv);
                }
            }
        }
     
    }
    PS: I am French and I use google translation
     
  2. tag the EventHandler
     
  3. Thanks, I had not seen xD
    I had made a copy paste