Add GoatHornEvent listener (stops spamming goat horns in spawn)

Implement GoatHornEvent to handle player interactions with goat horns. This feature sets a cooldown for goat horn items, if the player is near spawn or already has an active cooldown.
This commit is contained in:
Teriuihi 2024-08-11 23:49:02 +02:00
parent 0c305e79e5
commit c0c8cbbfa4

View File

@ -29,8 +29,8 @@ public class GoatHornEvent implements Listener {
return;
}
Location spawn = player.getLocation();
spawn.set(0, 0, 0);
Location spawn = player.getLocation().clone();
spawn.set(0, player.getY(), 0);
if (player.getLocation().distance(spawn) > 250) {
return;