import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class MyPlugin extends JavaPlugin implements Listener {

@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction().toString().contains("RIGHT_CLICK")) {
event.getPlayer().sendMessage("You clicked the right mouse button!");
}
}
}

computer2know :: thank you for your visit :: have a nice day :: © 2024