@EventHandler
	public void onToggle(PlayerInteractEvent event){
		Player player = event.getPlayer();
		if(player.getItemInHand().equals(Main.torch)){
			if(player.hasPermission("torch.use")){
				if(Main.players.contains(player.getName())){
					if((event.getAction().equals(Action.LEFT_CLICK_AIR)) || (event.getAction().equals(Action.LEFT_CLICK_BLOCK))){
						if(Main.mode.containsKey(player.getName())){

							Mode mode = Main.getType(player);

							int typeindex = Main.getType(player).ordinal();

							if(typeindex == Mode.values().length - 1){
								typeindex = 0;
							}else{
								typeindex++;
							}

							Main.mode.put(player.getName(), Mode.values()[typeindex]);
							n.sendMode(player, mode);

						}else{
							Main.mode.put(player.getName(), Mode.Lightning);
							player.sendMessage(ChatColor.BLUE + "Mode: " + Main.getType(player));
						}
					}else if((event.getAction().equals(Action.RIGHT_CLICK_AIR)) || (event.getAction().equals(Action.RIGHT_CLICK_BLOCK))){
						String modeclass = "me.captainbern.torchofnotch.modes." + Main.getType(player).toString() + "Effect";	
						Effect effect = null;
						try {
							effect = (Effect) Class.forName(modeclass).newInstance();
							effect.onTorchStrikeEvent(player);
						} catch (InstantiationException e) {
							Main.plugin.getLogger().warning("Could not instantiate class " + modeclass);
							player.sendMessage(ChatColor.RED + "Could not instantiate class " + modeclass);
							e.printStackTrace();
						} catch (IllegalAccessException e) {
							Main.plugin.getLogger().warning("Could not access class " + modeclass);
							player.sendMessage(ChatColor.RED + "Could not access class " + modeclass);
							e.printStackTrace();
						}catch(ClassNotFoundException e){
							Main.plugin.getLogger().warning("Could not find class " + modeclass);
							player.sendMessage(ChatColor.RED + "Could not find class " + modeclass);
							e.printStackTrace();
						}catch(Exception e){
							Main.plugin.getLogger().warning("A wild error occurred");
							player.sendMessage(ChatColor.RED + "A wild error occurred!");
							e.printStackTrace();
						}
					}
				}
			}
		}
	}