Player interact event help

Discussion in 'Plugin Development' started by dsdevil, Mar 15, 2015.

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

    dsdevil

    Ok so i made an event when a player clicks an enderchest it sends him a message but for some reason its sending the message with every block here is my code
    Code:
        @EventHandler
        public void onInteract(PlayerInteractEvent e){
            Player who = e.getPlayer();
        if (e.getAction() == Action.LEFT_CLICK_BLOCK){
        if (e.getClickedBlock().getType() == Material.ENDER_CHEST);
                if (fileUtil.getSize(who) >= 45) {
                    who.sendMessage(ChatColor.RED
                            + "Your bank is already the max size!");
                    return;
                }
     
  2. Offline

    nverdier

    @dsdevil You have a semi-colon right after your if statement checking if the clicked block is an Ender Chest. I recommend learning Java before using the Bukkit API, but that's your problem right there.
     
Thread Status:
Not open for further replies.

Share This Page