My server stops randomly

my server stops because of this code how do i make this so it does not crash my server
Code:
@EventHandler
public void startgame(PlayerInteractEvent e){
if (e.getMaterial().equals(Material.CROSSBOW)) {
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes(’&’, “&6&lWelcome to &e&lMobile Legends”));
e.getPlayer().getInventory().clear();
}
if (e.getMaterial().equals(Material.BOW)) {
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes(’&’, “&6&lWelcome to &e&lMobile Legends”));
e.getPlayer().getInventory().clear();
}
if (e.getMaterial().equals(Material.NETHERITE_SWORD)) {
e.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes(’&’, “&6&lWelcome to &e&lMobile Legends”));
e.getPlayer().getInventory().clear();

	}
	
}
  1. use also elseif you can only interact with 1 item.
  2. ask if item is != null cause it can be.
  3. your server cant crash cause of this.
  4. use Components instead of direct strings: Component.text(copy string or message here);
  5. did you register the event and implemented the Listener to the class?