I am using 1.16.2 Spigot library/Bukkit API My simple code:
if (event.getSlot() == 11 && event.getCurrentItem().getType() == Material.STICK) {