So I need to get the name of the player who's food level changed so I can see if they have the required permission. I am using FoodLevelChangeEvent.
Please paste your code so we can see what you're doing wrong. You have to get the player from the event object by calling getPlayer() on it.
Got : public void FoodLevelChange(FoodLevelChangeEvent event){ Player player = event.getPlayer(); if (player.hasPermission("test.permission")){ player.setFoodLevel(20); Bukkit.broadcastMessage("Filled"); } } But its still throwing an error at event.getPlayer();
Sorry again, I completely forgot you had to cast it This should work: Player player = (Player) e.getEntity();