Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Java
You last visited: Today at 16:15

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



need help with bukkit InventoryClickEvent

Discussion on need help with bukkit InventoryClickEvent within the Java forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2019
Posts: 1
Received Thanks: 0
need help with bukkit InventoryClickEvent

Hey, im making a plugin for my server (Coinflip) and added an InventoryClickEvent which was working a few days ago, but when i run the plugin now, its not working anymore even if i dont rly changed anything, the onclick event is just not getting activated in any ways, as if there wouldnt be someone who clicks anything...

Code:
    [MENTION=555807]event[/MENTION]Handler
    public void onClick(InventoryClickEvent e) {
        Player p = (Player) e.getWhoClicked();
        if (e.getInventory().getTitle().equals("!Choose your color!")) {
            if(e.isRightClick() || e.isLeftClick()){
                e.setCancelled(true);
            }
            colorid.add((short) e.getSlot());
            p.closeInventory();
            p.sendMessage(ChatColor.GREEN + "You created a challenge about " +  MavacsStupidCoinflip.money + "$!");
            sort();

        }
        if(e.getInventory().getTitle().equals("!Coinflip Challenges!")) {
            if(e.isRightClick() || e.isLeftClick()){
                e.setCancelled(true);
            }
        }
    }
this should normaly work but i have completly no idea why its not working...already checked if its because of the name, but its EXACTLY the same name of the inventory
Keokix is offline  
Old 08/17/2019, 16:24   #2
Moderator


 
elite*gold: 558
Join Date: Feb 2010
Posts: 6,546
Received Thanks: 1,418
Any exceptions in the log?

Send a message outside of the if's to the player. Is it displayed?
If not, have you registered the EventHandler?

Try it on a local server with a debugger. Then you will see exactly why the name does not match.
ComputerBaer is offline  
Reply

Tags
bukkit, coding, minecraft, plugins


Similar Threads Similar Threads
[24/7][Bukkit][Whitelist][1.5]--->YanTasy City<--- [1.5][Whitelist][Bukkit][24/7]
05/03/2011 - Minecraft Server Advertising - 70 Replies
Edit - Kommt auf dem server .... Wir spielen nun dort , Weil wird wahrscheinlich nicht mehr online kommen http://www.elitepvpers.com/forum/minecraft-server-a dvertising/1154447-no-whitelist-fontainecraft-24-7 -bukkit-32-slots-h-ndler.html
[Bukkit][24/7]Sinex Gaming 1.5_01[24/7][Bukkit]
04/29/2011 - Minecraft Server Advertising - 13 Replies
Sinex Gaming Es ist soweit. Nach 4 Tagen Harter Arbeit können wir endlich unseren Server für euch öffnen. Wir haben bisher noch keine Moderatoren, wenn ihr aber denkt ihr seid genau die richtige Person dazu dann bewerbt euch doch bei uns im Forum unter: Sinex-Gaming.de. Die Plugins: Elevators
[Bukkit][NO Whitelist][NOLAG] Flarecraft![Bukkit]
04/17/2011 - Minecraft Server Advertising - 5 Replies
Hello I'm the owner of FlareCraft. NEW SERVER HOSTER!!! NO LAG!!! Server IP Down at the bottom! Plugins: * Permissions * WorldEdit * WorldGuard * Essentials * Spells
[Bukkit][No whitelist] Flarecraft! [Bukkit][No Whitelist]
03/06/2011 - Minecraft Server Advertising - 8 Replies
Hello I'm the owner of FlareCraft. For one, we have no whitelist. Which makes it easier for people to get on. Plugins: * Permissions * WorldEdit * WorldGuard * Essentials * Spells * LWC * iChat



All times are GMT +1. The time now is 16:16.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.